Things have kind of run away with me. I've been working in Prolog for the last month or so. I'm not yet sure how to bring it together with the Python code.
12 KiB
12 KiB
In [1]:
from notebook_preamble import D, DefinitionWrapper, J, V, defineIn [2]:
J('[1 2 3] [size 1 <=] [pop []] [[[+] infra] dupdip first] [dip swons] genrec')[1 3]
In [3]:
J('[1 2 3] [size 1 <=] [[]] [[[+] infra] dupdip first] [dip swons] genrec')[6] [1 3]
In [4]:
J('[1 2 3] [size 1 <=] [] [[[+] infra] dupdip first] [dip swons] genrec')[1 3 6]
In [5]:
define('scan == [infra] cons [dupdip first] cons [size 1 <=] [] roll< [dip swons] genrec')In [6]:
J('[1 2 3 4] [+] scan')[1 3 6 10]
In [7]:
J('[1 2 3 4] [*] scan')[1 2 6 24]
In [8]:
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 [ ]: