Re: routine_id evaluation
- Posted by Matt Lewis <matthewwalkerlewis at YAHOO.COM> Dec 03, 2000
- 595 views
--- Derek Parnell <dparnell at BIGPOND.NET.AU> wrote: > Robert, > I don't suppose you'd consider allowing routine_id to be evaluated at > run-time rather than at "compile" time? (I know you took this off list, but...) I guess I finally understand what you're talking about: forward referencing (although that's not how you're phrasing it). As with most stumpers like this IMHO, you should be able to get around it with a little bit of indirection: -- begin code sequence handles handles = { {}, {} } -- you could also use Jiri's associative lists :) procedure do_proc( sequence name ) call_proc( find(name, handles[1]), {}) end procedure procedure main() do_proc( "foo1") end procedure procedure foo1() -- stuff end procedure handles[1] &= { "foo1" } procedure foo2() -- more stuff end procedure handles[1] &= {"foo2"} for i = 1 to length(handles[1]) do handles[2] &= routine_id(handles[1][i]) end for -- end code Of course, you couldn't do exactly what you were asking, but with some slight modifications, it should work. ===== Matt Lewis http://www.realftp.com/matthewlewis __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/