September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -1,7 +1,7 @@
/*REXX program demonstrates a REXX currying method to perform addition. */
say 'add 2 to 3: ' add(2 ,3)
say 'add 2 to 3 (curried):' add2(3)
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────subroutines─────────────────────────*/
add: procedure; $=arg(1); do j=2 to arg(); $=$+arg(j); end; return $
add2: procedure; return add(arg(1), 2)
/*REXX program demonstrates a REXX currying method to perform addition. */
say 'add 2 to 3: ' add(2, 3)
say 'add 2 to 3 (curried):' add2(3)
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
add: procedure; $= arg(1); do j=2 to arg(); $= $ + arg(j); end; return $
add2: procedure; return add( arg(1), 2)

View file

@ -1,12 +1,12 @@
/*REXX program demonstrates a REXX currying method to perform addition. */
say 'add 2 to 3: ' add(2 ,3)
say 'add 2 to 3 (curried):' add2(3)
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────ADD subroutine──────────────────────*/
add: procedure; $=0; do j=1 for arg()
do k=1 for words(arg(j)); $=$+word(arg(j),k)
end /*k*/
end /*j*/
return $
/*──────────────────────────────────ADD2 subroutine─────────────────────*/
add2: procedure; return add(arg(1), 2)
/*REXX program demonstrates a REXX currying method to perform addition. */
say 'add 2 to 3: ' add(2, 3)
say 'add 2 to 3 (curried):' add2(3)
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
add: procedure; $= 0; do j=1 for arg()
do k=1 for words( arg(j) ); $= $ + word( arg(j), k)
end /*k*/
end /*j*/
return $
/*──────────────────────────────────────────────────────────────────────────────────────*/
add2: procedure; return add( arg(1), 2)