* VM creates arrays using the BeginArray and EndArray instructions * ArrayObj is implemented with a __str__ function (annoying) * Simple example of array creation is added Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
15 lines
226 B
Plaintext
15 lines
226 B
Plaintext
# Create an array with just some numbers
|
|
{ 1 2 3 }
|
|
println!
|
|
|
|
[ :x x x ] :dup
|
|
# Call some functions
|
|
{ 1 dup! dup! }
|
|
println!
|
|
|
|
# Call your own functions, why not?
|
|
{
|
|
[ 2 *! ] :double
|
|
1 dup! double! dup! double!
|
|
}
|
|
println! |