Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -1,12 +0,0 @@
/*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

View file

@ -1,7 +1,8 @@
include Settings
Main:
say version; say 'Higher-order functions'; say
say 'HIGHER-ORDER FUNCTIONS - 2 Mar 2025'
say version
say
call Calculate '1/x',6
call Calculate 'Sqrt(x)',2
call Calculate 'Sin(x)',1
@ -14,14 +15,9 @@ exit
Calculate:
procedure
parse arg ff,xx
say ff 'for x='xx 'makes' Evaluate(ff,xx)+0
say ff 'for x='xx 'makes' Eval(ff,xx)+0
return
Evaluate:
procedure
parse arg f,x
interpret 'return' f
include Functions
include Constants
include Abend