A minimalistic programming language written in C89.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
673 B

fn print_n_utf8 do
print_n_utf8_impl drop
end
# Clones an array, creating a new array
#
# @param array The array to clone into a new array
# @return a new array that contains the same elements as the source array
#
# array -> new_array
fn array.clone do
array.new 2 pluck array.size 0
# array new_array end it
2 pluck 2 pluck == l jump_if
# array new_array end it
loop:
dup 5 pluck
# array new_array end it it array
array.index 4 pluck
# array new_array end it v new_array
array.push
# array new_array end it
1 +
2 pluck 2 pluck > loop jump_if
l: drop drop swap drop
# new_array
end