seq-compiler 2.0.1

Compiler for the Seq programming language
Documentation
# Test stack-utils - tests the builtin 2dup and 3drop operations

# 2drop is not a builtin, so define it here
: 2drop ( A B -- )
  drop drop
;

: main ( -- )
  # Test 2dup builtin
  1 2 2dup
  2 = swap 1 = and 2drop
  if
    "2dup works ✓" io.write-line
  else
    "2dup FAILED" io.write-line
  then

  5 10 15
  2drop
  15 =
  if
    "2drop works ✓" io.write-line
  else
    "2drop FAILED" io.write-line
  then

  1 2 3 4
  3drop
  4 =
  if
    "3drop works ✓" io.write-line
  else
    "3drop FAILED" io.write-line
  then
;