routine_id scope
- Posted by xecronix Oct 20, 2015
- 1580 views
Forked from Re: Is there a good Windows or cross-platform Euphoria IDE?
dcuny said...
This also confuses me:
public function Icallback( sequence name, atom rid = routine_id(name) ) return call_back( rid ) end function
From your example, it looks like you can not only do an assignment to a non-constant value, but you can pass one of the parameter values.
Where is this in the manual defined? The manual says:
PROCDECLARE ==: [SCOPETYPE] 'procedure' IDENTIFIER '(' [PARMLIST] ')' [STMTBLK] 'end' 'procedure' PARMLIST ==: PARAMETER [',' PARMLIST] PARAMETER ==: DATATYPE IDENTIFER
Maybe it's just that my Google-fu skills are lacking, but I can't find any mention default parameter values in the on-line manual.
There are some examples where they are used, but that's not quite the same.
- David
I found some discussion on scope for routine_id but nothing that calls attention to Greg's trick.
- http://openeuphoria.org/docs/dynamic.html#_636_indirectroutinecalling
- http://openeuphoria.org/docs/std_machine.html#_5796_routine_id