Re: Introductions
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Dec 30, 1997
- 789 views
A few days ago Ralf wrote: > constant routine my_pixel = routine_id ("MCGA_Pixel") > my_pixel ({3,3,4}, {100,100}) > instead of: > call_proc(my_pixel, {{3,3,4},{100,100}}) > And it has to be faster.. (which should be possible using a special > data type. It wouldn't be much faster to execute - the same intermediate language code would be needed in either case to make the call. You would only save the sequence construction time for joining {3,3,4} and {100,100} together into one sequence, but that's pretty fast. I don't think the extra overhead of a call_proc vs. a normal call is that great. Do you have a real-life example where it matters? If so, time it and let us know. > Also it would be nice if we could call built-in routines also. It's rather difficult to make call_proc/call_func work with built-in routines, e.g. floor, sin, rand etc. I agree it might be nice to have that kind of generality, but actually these built-ins (built in to ex.exe) are not implemented as Euphoria subroutines, or even as C subroutines internally. They are handled by Euphoria in the same way as it handles primitive operations like +, -, [ ], & etc. Built-ins may be called by the Euphoria programmer using round brackets, e.g. floor(x), but they are not implemented as subroutine calls. It's done more efficiently than that. So for now, call_proc/call_func are limited to routines that you write in Euphoria. If there's a big demand for it I might reconsider. Regards, Rob Craig Rapid Deployment Software