Giving fucnction parameters defaults assigned values later

new topic     » topic index » view thread      » older message » newer message

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).

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu