Anonymous user
Closures/Value capture: Difference between revisions
m
→{{header|REXX}}: added/changed comments and whitespace, changed indentations.
m (→{{header|REXX}}: added/changed comments and whitespace, changed indentations.) |
|||
Line 1,210:
=={{header|REXX}}==
<lang rexx>/*REXX
do j=1 for 9; ?=random(0,
interpret 'CALL .'
end /*j*/ /* [↑] the
say 'The tenth invocation of .0 ───► ' .0()
exit /*stick a fork in it, we're all done. */
/*───────────────────────────[Below is the closest thing to anonymous functions in
▲/*[Below is the closest thing to anonymous functions in the REXX lang.] */
/*──────────────────────────────────────────────────────────────────────────────────────*/
▲ .5:return .(); .6:return .(); .7:return .(); .8:return .(); .9:return .()
.: if symbol('@')==
'''output'''
▲.: if symbol('@')=='LIT' then @=0 /*handle 1st invoke*/; @=@+1; return @*@</lang>
<pre>
The tenth invocation of .0 ───► 100
|