Re: A rather dreamy request...
- Posted by Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL> Aug 19, 1998
- 416 views
Hawke, what exactly is the difference with this approuch other than syntaxtical ? constant btnStartTimer[clicked] = routine_id ("btnStartTimerRoutine") And then call it like: call_proc (btnStartTimer[clicked]) The difference is, the routine could in your approuch not be called in a normal sence. So, your real suggestion is about the scope rules of routines. Your point however stands, but I would appriciate to clearify how (IMHO) it would make more sense and be more consistent: 1) Everything we can declare local or global can *now* also be declared local to an variable or data type. Now you wonder: can't we already do that with all other data types ? No, not with constants: Im talking e-nummeration here. So we could have a sequence, containing atoms, sequences, routines, and constants. ? btnStartTimer[my_routine] btnStartTimer[my_constant] = 4 -- Error: value is 'locked-in' btnStartTimer = {1,2,2,2,2} -- This *is* allowed Next to this consider ennumeration: a constant local to an atom can only be used to assign or compare that atom with. Do that same with routines: this atom can only be an argument for that routine. So, every datatype (sequence, onbject, atom) has their own list of constants and routines. What you people think about this idea ? Lastly, ive got another request: (automatic constant assingment) Some one asked for new elements to be appended if they are one over length. What about this (more safe) approuch sequence my_sequence element pizza = 5 element radio = 3 element name = "Euphoria" ? my_sequence -- print {5,3,"Euphoria"} element addres = "members.aol.com/FilesEU" ? my_sequence[radio] -- print 3 link other_sequence element top = 230 link third_sequence[3] as short_name do element music = "POP" ? short_name[music] The link makes a sequence for use with the 'element' operator And optionally you can add an 'as ..' to have an alias for a sequence: link fourth_sequence[1][2][3][4][5] as index do for a = 1 to 1230 do ? index * a end for -- Now I know it is optimized, but these kind of things make it look more clear, make it easier for ex.exe to optimize and together with the 'element' operator allow nice subscription. Here my drain of thoughts stops, thanx for listening.. Ralf