diff options
Diffstat (limited to 'test.fp')
-rw-r--r-- | test.fp | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -10,20 +10,27 @@ (nil eq) $null? ($x x) $force (10 emit) $cr - - ; recursion via y-combinator - ($f ($x (^x x) f) dup force) $Y ($g (^g Y)) $rec + (dup car swap cdr) $carcdr ; if-stmt ($c $t $f c ^f ^t rot cswap $_ force) $if ($f $t $c $fn ^f ^t ^c fn) $endif ; range - ($self $body $start $end - ^if (^start ^end eq) nil - (^start body ^end ^start 1 + ^body self) + ($self $start $end + ^if (^start ^end eq) + ^nil + (^start ^end ^start 1 + self swap cons) + endif + ) $range + + ($self $func $list + ^if (^list null?) + nil + (^list carcdr swap func ^func self) endif - ) rec $do + ) $foreach - 70 65 ^emit do cr + 58 48 range + ^emit foreach cr ) |