Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,34 @@
needs array'
( Create an array with four elements )
^array'new{ 1 2 3 4 } constant a
( Add 10 to each element in an array and update the array with the results )
a [ 10 + ] ^array'map
( Apply a quote to each element in an array; leaves the contents alone )
a [ 10 + putn cr ] ^array'apply
( Display an array )
a ^array'display
( Look for a value in an array )
3 a ^array'in?
6 a ^array'in?
( Look for a string in an array )
"hello" a ^array'stringIn?
( Reverse the order of items in an array )
a ^array'reverse
( Append two arrays and return a new one )
^array'new{ 1 2 3 } constant a
^array'new{ 4 5 6 } constant b
a b ^array'append constant c
( Create an array from the values returned by a quote )
[ 1 2 "hello" "world" ] ^array'fromQuote constant d
( Create a quote from the values in an array )
d ^array'toQuote