Ixth
Jump to navigation
Jump to search
Designed by | munvoseli |
---|---|
Appeared in | 2022 |
Computational class | Unknown |
Reference implementation | ixth on github |
File extension(s) | .ixth , .txt |
Ixth is a stack-based language. Instead of operators such as drop, swap, or dup, it features one customizable stack operator.
( a b -- b a )
is equivalent to swap.
( a -- )
is equivalent to drop.
( a -- a a )
is equivalent to dup.
( a b c -- c a b )
and ( a b c -- b c a )
perform rotations.
Example
9 8 add print 5 6 ( a b -- b a ) print print func hello 5 5 add print ret hello 8 { ( a -- a a ) print 1 sub ( a -- a a ) print ( a -- a a ) if 1 gob fi 1 gof } ( a -- ) 8 8 8 add add print 0 if 1 print else 1 if 2 print 0 if 1 print else 1 if 4 print fi else 1 if 3 print fi