2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,14 +1,13 @@
/*REXX pgm has a list of 10 functions, each returns its invocation(idx)²*/
/*REXX program has a list of ten functions, each returns its invocation (index) squared.*/
do j=1 for 9 /*invoke random functions 9 times.*/
interpret 'CALL .'random(0,9) /*invoke a randomly selected func.*/
end /*j*/ /* [↑] the random func has no args*/
do j=1 for 9; ?=random(0, 9) /*invoke random functions nine times.*/
interpret 'CALL .'? /*invoke a randomly selected function. */
end /*j*/ /* [↑] the called function has no args*/
say 'The tenth invocation of .0 ' .0()
exit /*stick a fork in it, we're done.*/
/*─────────────────────────────────list of 10 functions─────────────────*/
/*[Below is the closest thing to anonymous functions in the REXX lang.] */
.0:return .(); .1:return .(); .2:return .(); .3:return .(); .4:return .()
.5:return .(); .6:return .(); .7:return .(); .8:return .(); .9:return .()
/*─────────────────────────────────. function───────────────────────────*/
.: if symbol('@')=='LIT' then @=0 /*handle 1st invoke*/; @=@+1; return @*@
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 REXX]*/
.0: return .(); .1: return .(); .2: return .(); .3: return .(); .4: return .()
.5: return .(); .6: return .(); .7: return .(); .8: return .(); .9: return .()
/*──────────────────────────────────────────────────────────────────────────────────────*/
.: if symbol('@')=="LIT" then @=0 /* ◄───handle very 1st invoke*/; @=@+1; return @*@