Skip to content

Instantly share code, notes, and snippets.

@oerpli
Last active December 15, 2015 22:11
Show Gist options
  • Select an option

  • Save oerpli/98a5ce1a2461361f76b1 to your computer and use it in GitHub Desktop.

Select an option

Save oerpli/98a5ce1a2461361f76b1 to your computer and use it in GitHub Desktop.
: rl s" test.fs" included ;
: arrange { a b c d a1 b1 c1 d1 -- n n }
a a1 b b1 c c1 d d1 ;
: neg ( n -- n)
0 swap - ;
: checkEqual { a b c d a1 b1 c1 d1 -- n }
a a1 =
b b1 =
c c1 =
d d1 =
+ + + neg ;
: curry ( x xt1 -- xt2 )
swap 2>r :noname r> postpone literal r> compile, postpone ; ;
: currychk ( x x x x -- xt2 )
\ call like this: 1 2 3 4 currychk is chk
[ ' checkEqual ] literal curry curry curry curry ;
defer chk
: check ( x x x x -- u )
chk ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment