Re: Include dir as built-in function
- Posted by Marco Achury <achury at can?v.?et> Apr 29, 2008
- 635 views
I understand that is important to keep the interpreter small. But I don't understand why there are a lot of function at include as: global function dir(sequence name) -- returns directory information, given the name -- of a file or directory. Format returned is: -- { -- {"name1", attributes, size, year, month, day, hour, minute, second}, -- {"name2", ... }, -- } return machine_func(M_DIR, name) end function The function is really just one line of code. M_DIR is a constant with value 22. The include files are plenty of this kind of functions. ¿How big is the effect on interpreter speed/size if some of this functions become internals. Another example is function wait_key(), this is strongly used on text mode apps, like ED.EX. global function wait_key() -- Get the next key pressed by the user. -- Wait until a key is pressed. return machine_func(M_WAIT_KEY, 0) end function M_WAIT_KEY is a constant = 26 What gives better performance? As built-in or as include? +-+-+-+-+-+-+-+ Marco A. Achury Caracas, Venezuela