Skip to content

Instantly share code, notes, and snippets.

@booo
Created April 27, 2014 13:47
Show Gist options
  • Save booo/11346045 to your computer and use it in GitHub Desktop.
Save booo/11346045 to your computer and use it in GitHub Desktop.
$ 'main'
\
-n1:2:-{list_reverse}-{list_reverse}-{list_print}-#
-n1:2:-{list_reverse}-{list_print}-#
test for list_append
--n1:0:-n2:3:-{list_append}-{list_print}-#
test for list_len
---n1:2:3:{list_len}o#
test for list_print
-n2:1:{list_print}#
$ 'drop' (a -- )
\
\-(!a!)-#
$ 'dup'
\
-(!store!)-(store)-(store)-#
$ 'flip'
\
-(!a!)-(!b!)-(a)-(b)-#
$ 'list_reverse'
\
\
\ --~-(!head!)-{list_reverse}-n(head):-{flip}-{list_append}-#
\ /
----{dup}-n-q-<
\
-# return leere liste
(++) [] ys = ys
(++) (x:xs) ys = x : xs ++ ys
$ 'list_append'
\ -~-(!head!)-{list_append}-(head)-:-#
\ /
---{dup}--n-q-<
\
-(!!)-#
$ 'list_print'
\
\ -~-o-{list_print}-#
\ /
-{dup}-n-q-<
\
#
$ 'list_len'
\ -~-{drop}-{list_len}-1-a-#
\ /
---{dup}-n-q-<
\
-0-#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment