Fix cookbook typo
parent
19e6e0a958
commit
a06e8ef1e7
|
@ -100,14 +100,12 @@ $nl
|
||||||
{ $code "10 [ \"Factor rocks!\" print ] times" }
|
{ $code "10 [ \"Factor rocks!\" print ] times" }
|
||||||
"Now we can look at a new data type, the array:"
|
"Now we can look at a new data type, the array:"
|
||||||
{ $code "{ 1 2 3 }" }
|
{ $code "{ 1 2 3 }" }
|
||||||
"An array looks like a quotation except it cannot be evaluated; it simply stores data."
|
"An array differs from a quotation in that it cannot be evaluated; it simply stores data."
|
||||||
$nl
|
$nl
|
||||||
"You can perform an operation on each element of an array:"
|
"You can perform an operation on each element of an array:"
|
||||||
{ $example
|
{ $example
|
||||||
"{ 1 2 3 } [ \"The number is \" write . ] each"
|
"{ 1 2 3 } [ \"The number is \" write . ] each"
|
||||||
"The number is 1"
|
"The number is 1\nThe number is 2\nThe number is 3"
|
||||||
"The number is 2"
|
|
||||||
"The number is 3"
|
|
||||||
}
|
}
|
||||||
"You can transform each element, collecting the results in a new array:"
|
"You can transform each element, collecting the results in a new array:"
|
||||||
{ $example "{ 5 12 0 -12 -5 } [ sq ] map ." "{ 25 144 0 144 25 }" }
|
{ $example "{ 5 12 0 -12 -5 } [ sq ] map ." "{ 25 144 0 144 25 }" }
|
||||||
|
|
Loading…
Reference in New Issue