Re: Forward referencing
- Posted by CChris <christian.cuvier at ag?icult?re.gouv.fr> May 01, 2008
- 635 views
Jason Gade wrote: > > I believe that the bug referenced only applied to routine_id() calls, not > forward > referencing in general. > > Enabling code like this: > > }}} <eucode> > function Func1( integer i ) > return call_func( routine_id("Func2"), {2} ) -- "Func2" not resolved until > called > end function > > function Func2( integer i ) > return i * 2 > end function > </eucode> {{{ > > I support this bug/feature for routine_id, not for general forward > referencing. > I've heard that it would have helped writing Win32lib greatly. > > -- > A complex system that works is invariably found to have evolved from a simple > system that works. > --John Gall's 15th law of Systemantics. > > "Premature optimization is the root of all evil in programming." > --C.A.R. Hoare > > j. In a project with hundreds of routines that may call one another in any order and are hopefully split across a few files, imagine how tricky it is to position routines so that they are seen by the includes that need them and appear after any routine thta calls them. You can do everything using routine_ids, but this accounted for a few dozens of undocumented global symbols in previous versions of win32lib. I could clean up that mess using the alternate w32routine_id, but: * routine placement is just doable, not easily so * any given large library has no need for a w32routine_id mechanism. Forward referencing is not a problem at all: see Orac and my modified interperter, for instance. Additionally, backward referencing forces to write program upside down: utilities first, then routines that call them, and on and on. I don't know about you, but I usually read from top to bottom. This makes programs needlessly harder to understand. CChris