RosettaCodeData/Task/Arrays/Phixmonti/arrays.phixmonti
2023-07-01 13:44:08 -04:00

15 lines
754 B
Text

include ..\Utilitys.pmt
0 tolist /# create an empty array/list. '( )' is equivalent #/
drop /# remove top of the stack #/
0 10 repeat /# put an array/list of 10 elements (each element has value 0) to the stack #/
flush /# remove all elements. List is empty [] #/
drop
( 1 2 "Hello" pi ) /# put an initialize array/list to stack #/
-7 1 set /# modified first element to -7 #/
0 get /# get the last element. '-1 get' is equivalent #/
drop
( "next" "level" ) 2 put /# insert a list in a list = [-7, ["next", "level"], 2, "Hello", 3.141592653589793]] #/
3 2 slice /# extract the subarray/sublist [ 2 "Hello" ] #/
pstack /# show the content of the stack #/