From: Sven E. <sve...@we...> - 2008-02-11 17:29:17
|
Eric Bezault wrote: > Sven Ehrke wrote: >> I know it is a bit late now (just saw your commit) but I have mixed feelings about <group>. >> What is again the advantage over calling another target? > > One advantage I could see is with local variables. With > another target we would have to pass them as arguments, Right. Especially when there are many which need to be accessed this would be annoying. > and they would be read-only I guess. Good point. I obviously did not think enough about this one. This means that the idea of slowly going away from globals to locals will not work since we cannot return values. So I make another suggestion which I had in mind since a long time. So far I thought it is overkill for geant but just to mention the idea: We could extend the OO view of geant scripts (similar to a Eiffel class) by providing the possibility to add attributes to a script so that it becomes stateful. This way targets (like features in Eiffel) could modify the values of these attributes. It would be necessary to able to create new "objects" of these "scripts" and pass them as arguments for example. This way we could get rid of the globals. But it is certainly some effort involved to implement this. - Sven |