Giving fucnction parameters defaults assigned values later
- Posted by ArthurCrump Jun 06, 2013
- 1342 views
In Euphoria version 4.05 a parameter default can be a variable which is only assigned a value after the function declaration. For example, the following code works when the function foo is called.
object par_default -- Currently no value -- More coding function foo(object mypay=par_default) -- some code return mypar -- Or something more useful end function -- More coding par_default = 55 -- More coding ?foo()
Can this behaviour be relied upon in future versions? I would like to put my routines before the constants which are used for the default parameter values so that the routine is documented before the constants (using creole).