aboutsummaryrefslogtreecommitdiffstats
path: root/test.fp
blob: 3663d155a5bc6c01c82845405904d4efb64ad5ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(
  ; core utilities
  ($_)                $drop
  ($x $y ^x ^y)       $swap
  ($a $b $c ^b ^a ^c) $rot
  (sub)               $-
  (0 swap - -)        $+
  ($x x)              $force
  (32 emit)           $bl
  (10 emit)           $cr

  ; if-stmt
  (force cswap drop force)   $if
  ($f $t $c $fn ^f ^t ^c fn) $endif

  ; range
  ($self $fn $start $end
    ^if (^start ^end eq) ()
      (^start fn ^end ^start 1 + ^fn self)
    endif
  ) $each

  10 0 ($i 10 0 ($j ^i 48 + emit ^j 48 + emit bl) each) each
  cr
)