12 KiB
12 KiB
In [2]:
from notebook_preamble import D, DefinitionWrapper, J, V, defineIn [3]:
J('[1 2 3] [size 1 <=] [pop []] [[[+] infra] dupdip first] [dip swons] genrec')[1 3]
In [4]:
J('[1 2 3] [size 1 <=] [[]] [[[+] infra] dupdip first] [dip swons] genrec')[6] [1 3]
In [5]:
J('[1 2 3] [size 1 <=] [] [[[+] infra] dupdip first] [dip swons] genrec')[1 3 6]
In [6]:
define('scan == [infra] cons [dupdip first] cons [size 1 <=] [] roll< [dip swons] genrec')In [7]:
J('[1 2 3 4] [+] scan')[1 3 6 10]
In [8]:
J('[1 2 3 4] [*] scan')[1 2 6 24]
In [9]:
J('[1 2 3 4 5 6 7] [neg +] scan')[1 1 2 2 3 3 4]
In [10]:
J('["hello" "world"] uncons ["\n" swap + +] step')'hello\nworld'
In [ ]: