Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Higher-order-functions/REXX/higher-order-functions.rexx
Normal file
12
Task/Higher-order-functions/REXX/higher-order-functions.rexx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/*REXX program demonstrates the passing of a name of a function to another function. */
|
||||
call function 'fact' , 6; say right( 'fact{'$"} = ", 30) result
|
||||
call function 'square' , 13; say right( 'square{'$"} = ", 30) result
|
||||
call function 'cube' , 3; say right( 'cube{'$"} = ", 30) result
|
||||
call function 'reverse', 721; say right( 'reverse{'$"} = ", 30) result
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
cube: return $**3
|
||||
fact: procedure expose $; !=1; do j=2 to $; !=!*j; end; return !
|
||||
function: arg ?.; parse arg ,$; signal value (?.)
|
||||
reverse: return 'REVERSE'($)
|
||||
square: return $**2
|
||||
Loading…
Add table
Add a link
Reference in a new issue