Re: Procs & Funcs
- Posted by Irv <irv at ELLIJAY.COM> May 03, 1998
- 542 views
At 02:01 PM 5/3/98 -0400, Rob Craig wrote: >I've been thinking about making a smarter bind program that >would detect unused stuff, and leave it out of the >.exe file (or shrouded source file). It would have to make >2 passes through all of the code. The first to detect unreferenced >symbols. The second to emit code into the .exe file for the routines >and variables that are actually used. routine_id() would >complicate matters a bit. It certainly would. If you do this, please make it optional. Routine_id is one of the most useful and powerful features of Euphoria. I am presently implementing inheritance using a sequence of routine_id's. Each object attaches its own "show" routine_id, for example, to the end of a list of "show" routine_id's passed (along with all the other properties) when a new object is declared as an instance of ancestor x. i.e.: bitmap_button = button This makes inheritance simple, as it's only necessary to declare the new object's added "show" behavior. The generic "Show (object)" routine only has to say: for i = 1 to length(object[SHOW]) do call_proc(object[SHOW][i],{}) end for which works with any object: Show(button), Show(bitmap_button), etc. Currently, I am building the sequence using routine_id #'s, but It would work using a sequence of function "names", or perhaps even *computed* names. (I don't yet know of a reason to do this, but that doesn't mean that someone smarter won't someday think of one.) Irv