Merge tag 'hoon-151' into pills

Hoon 151 merge
This commit is contained in:
Raymond Pasco 2016-02-10 15:16:45 -05:00
commit 101673f511
55 changed files with 3260 additions and 3077 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@ GRTAGS
/zod/ /zod/
# dependencies # dependencies
node_modules/ node_modules/
.sass-cache
# OS # OS
.DS_Store .DS_Store
# ?? # ??

View File

@ -32,7 +32,7 @@ install the new kernel is `|reset` in `dojo`. This rebuilds from the
`arvo` directory in the `home` desk in `%clay`. Currently, `|reset` `arvo` directory in the `home` desk in `%clay`. Currently, `|reset`
does not reload apps like `dojo` itself, which will still reference the does not reload apps like `dojo` itself, which will still reference the
old kernel. To force them to reload, make a trivial edit to their main old kernel. To force them to reload, make a trivial edit to their main
source file (under the `ape` directory) in `%clay`. source file (under the `app` directory) in `%clay`.
If you do any kernel development, be sure to read the section below about If you do any kernel development, be sure to read the section below about
pills. pills.

View File

@ -272,16 +272,13 @@ J_E_OFILES_ED=\
J_F_OFILES=\ J_F_OFILES=\
jets/f/al.o \ jets/f/al.o \
jets/f/ap.o \ jets/f/ap.o \
jets/f/bull.o \
jets/f/cell.o \ jets/f/cell.o \
jets/f/comb.o \ jets/f/comb.o \
jets/f/cons.o \ jets/f/cons.o \
jets/f/core.o \ jets/f/core.o \
jets/f/cube.o \
jets/f/face.o \ jets/f/face.o \
jets/f/fitz.o \ jets/f/fitz.o \
jets/f/flan.o \ jets/f/flan.o \
jets/f/flay.o \
jets/f/flip.o \ jets/f/flip.o \
jets/f/flor.o \ jets/f/flor.o \
jets/f/fork.o \ jets/f/fork.o \
@ -291,19 +288,14 @@ J_F_OFILES=\
J_F_OFILES_UT=\ J_F_OFILES_UT=\
jets/f/ut.o \ jets/f/ut.o \
jets/f/ut_burn.o \ jets/f/ut_burn.o \
jets/f/ut_busk.o \ jets/f/ut_buss.o \
jets/f/ut_bust.o \
jets/f/ut_conk.o \ jets/f/ut_conk.o \
jets/f/ut_crop.o \ jets/f/ut_crop.o \
jets/f/ut_cull.o \ jets/f/ut_find.o \
jets/f/ut_find.o \
jets/f/ut_fink.o \
jets/f/ut_fire.o \ jets/f/ut_fire.o \
jets/f/ut_firm.o \
jets/f/ut_fish.o \ jets/f/ut_fish.o \
jets/f/ut_fuse.o \ jets/f/ut_fuse.o \
jets/f/ut_gain.o \ jets/f/ut_gain.o \
jets/f/ut_heal.o \
jets/f/ut_lose.o \ jets/f/ut_lose.o \
jets/f/ut_mint.o \ jets/f/ut_mint.o \
jets/f/ut_mull.o \ jets/f/ut_mull.o \
@ -313,10 +305,8 @@ J_F_OFILES_UT=\
jets/f/ut_play.o \ jets/f/ut_play.o \
jets/f/ut_repo.o \ jets/f/ut_repo.o \
jets/f/ut_rest.o \ jets/f/ut_rest.o \
jets/f/ut_seek.o \
jets/f/ut_swab.o \
jets/f/ut_tack.o \ jets/f/ut_tack.o \
jets/f/ut_tock.o \ jets/f/ut_toss.o \
jets/f/ut_wrap.o jets/f/ut_wrap.o
J_G_OFILES=\ J_G_OFILES=\

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
A noun is an atom or a cell. A noun is an atom or a cell. An atom is a natural number. A cell is an ordered
An atom is a natural number. pair of nouns.
A cell is an ordered pair of nouns.
nock(a) *a nock(a) *a
[a b c] [a [b c]] [a b c] [a [b c]]
@ -37,3 +36,4 @@ nock(a) *a
*[a 10 b c] *[a c] *[a 10 b c] *[a c]
*a *a *a *a

View File

@ -10,6 +10,7 @@
# define c3__abo c3_s3('a','b','o') # define c3__abo c3_s3('a','b','o')
# define c3__actd c3_s4('a','c','t','d') # define c3__actd c3_s4('a','c','t','d')
# define c3__add c3_s3('a','d','d') # define c3__add c3_s3('a','d','d')
# define c3__aka c3_s3('a','k','a')
# define c3__all c3_s3('a','l','l') # define c3__all c3_s3('a','l','l')
# define c3__alrm c3_s4('a','l','r','m') # define c3__alrm c3_s4('a','l','r','m')
# define c3__amat c3_s4('a','m','a','t') # define c3__amat c3_s4('a','m','a','t')
@ -79,6 +80,8 @@
# define c3__blew c3_s4('b','l','e','w') # define c3__blew c3_s4('b','l','e','w')
# define c3__blin c3_s4('b','l','i','n') # define c3__blin c3_s4('b','l','i','n')
# define c3__blit c3_s4('b','l','i','t') # define c3__blit c3_s4('b','l','i','t')
# define c3__blob c3_s4('b','l','o','b')
# define c3__blob c3_s4('b','l','o','b')
# define c3__blog c3_s4('b','l','o','g') # define c3__blog c3_s4('b','l','o','g')
# define c3__bloq c3_s4('b','l','o','q') # define c3__bloq c3_s4('b','l','o','q')
# define c3__blot c3_s4('b','l','o','t') # define c3__blot c3_s4('b','l','o','t')
@ -144,6 +147,7 @@
# define c3__bump c3_s4('b','u','m','p') # define c3__bump c3_s4('b','u','m','p')
# define c3__bund c3_s4('b','u','n','d') # define c3__bund c3_s4('b','u','n','d')
# define c3__bung c3_s4('b','u','n','g') # define c3__bung c3_s4('b','u','n','g')
# define c3__bunt c3_s4('b','u','n','t')
# define c3__bunk c3_s4('b','u','n','k') # define c3__bunk c3_s4('b','u','n','k')
# define c3__burn c3_s4('b','u','r','n') # define c3__burn c3_s4('b','u','r','n')
# define c3__busk c3_s4('b','u','s','k') # define c3__busk c3_s4('b','u','s','k')
@ -321,6 +325,7 @@
# define c3__dtbn c3_s4('d','t','b','n') # define c3__dtbn c3_s4('d','t','b','n')
# define c3__dtcs c3_s4('d','t','c','s') # define c3__dtcs c3_s4('d','t','c','s')
# define c3__dtdt c3_s4('d','t','d','t') # define c3__dtdt c3_s4('d','t','d','t')
# define c3__dthx c3_s4('d','t','h','x')
# define c3__dtkt c3_s4('d','t','k','t') # define c3__dtkt c3_s4('d','t','k','t')
# define c3__dtlc c3_s4('d','t','l','c') # define c3__dtlc c3_s4('d','t','l','c')
# define c3__dtls c3_s4('d','t','l','s') # define c3__dtls c3_s4('d','t','l','s')
@ -381,6 +386,7 @@
# define c3__fish c3_s4('f','i','s','h') # define c3__fish c3_s4('f','i','s','h')
# define c3__fist c3_s4('f','i','s','t') # define c3__fist c3_s4('f','i','s','t')
# define c3__fit c3_s3('f','i','t') # define c3__fit c3_s3('f','i','t')
# define c3__fits c3_s4('f','i','t','s')
# define c3__fix c3_s3('f','i','x') # define c3__fix c3_s3('f','i','x')
# define c3__fl c3_s2('f','l') # define c3__fl c3_s2('f','l')
# define c3__flac c3_s4('f','l','a','c') # define c3__flac c3_s4('f','l','a','c')
@ -395,6 +401,7 @@
# define c3__flot c3_s4('f','l','o','t') # define c3__flot c3_s4('f','l','o','t')
# define c3__flow c3_s4('f','l','o','w') # define c3__flow c3_s4('f','l','o','w')
# define c3__fon c3_s3('f','o','n') # define c3__fon c3_s3('f','o','n')
# define c3__fond c3_s4('f','o','n','d')
# define c3__for c3_s3('f','o','r') # define c3__for c3_s3('f','o','r')
# define c3__forb c3_s4('f','o','r','b') # define c3__forb c3_s4('f','o','r','b')
# define c3__fore c3_s4('f','o','r','e') # define c3__fore c3_s4('f','o','r','e')
@ -406,6 +413,7 @@
# define c3__frez c3_s4('f','r','e','z') # define c3__frez c3_s4('f','r','e','z')
# define c3__frit c3_s4('f','r','i','t') # define c3__frit c3_s4('f','r','i','t')
# define c3__from c3_s4('f','r','o','m') # define c3__from c3_s4('f','r','o','m')
# define c3__frog c3_s4('f','r','o','g')
# define c3__fron c3_s4('f','r','o','n') # define c3__fron c3_s4('f','r','o','n')
# define c3__fry c3_s3('f','r','y') # define c3__fry c3_s3('f','r','y')
# define c3__fuge c3_s4('f','u','g','e') # define c3__fuge c3_s4('f','u','g','e')
@ -416,6 +424,7 @@
# define c3__fung c3_s4('f','u','n','g') # define c3__fung c3_s4('f','u','n','g')
# define c3__funk c3_s4('f','u','n','k') # define c3__funk c3_s4('f','u','n','k')
# define c3__fuse c3_s4('f','u','s','e') # define c3__fuse c3_s4('f','u','s','e')
# define c3__fuss c3_s4('f','u','s','s')
# define c3__gab c3_s3('g','a','b') # define c3__gab c3_s3('g','a','b')
# define c3__galb c3_s4('g','a','l','b') # define c3__galb c3_s4('g','a','l','b')
# define c3__gald c3_s4('g','a','l','d') # define c3__gald c3_s4('g','a','l','d')
@ -501,6 +510,7 @@
# define c3__hit c3_s3('h','i','t') # define c3__hit c3_s3('h','i','t')
# define c3__hmal c3_s4('h','m','a','l') # define c3__hmal c3_s4('h','m','a','l')
# define c3__hold c3_s4('h','o','l','d') # define c3__hold c3_s4('h','o','l','d')
# define c3__holt c3_s4('h','o','l','t')
# define c3__hole c3_s4('h','o','l','e') # define c3__hole c3_s4('h','o','l','e')
# define c3__home c3_s4('h','o','m','e') # define c3__home c3_s4('h','o','m','e')
# define c3__homp c3_s4('h','o','m','p') # define c3__homp c3_s4('h','o','m','p')
@ -686,6 +696,7 @@
# define c3__miss c3_s4('m','i','s','s') # define c3__miss c3_s4('m','i','s','s')
# define c3__mix c3_s3('m','i','x') # define c3__mix c3_s3('m','i','x')
# define c3__mod c3_s3('m','o','d') # define c3__mod c3_s3('m','o','d')
# define c3__moat c3_s4('m','o','a','t')
# define c3__mold c3_s4('m','o','l','d') # define c3__mold c3_s4('m','o','l','d')
# define c3__mong c3_s4('m','o','n','g') # define c3__mong c3_s4('m','o','n','g')
# define c3__mono c3_s4('m','o','n','o') # define c3__mono c3_s4('m','o','n','o')
@ -725,8 +736,8 @@
# define c3__new c3_s3('n','e','w') # define c3__new c3_s3('n','e','w')
# define c3__newt c3_s4('n','e','w','t') # define c3__newt c3_s4('n','e','w','t')
# define c3__next c3_s4('n','e','x','t') # define c3__next c3_s4('n','e','x','t')
# define c3__nich c3_s4('n','i','b','h') # define c3__nich c3_s4('n','i','c','h')
# define c3__nick c3_s4('n','i','b','k') # define c3__nick c3_s4('n','i','c','k')
# define c3__nil c3_s3('n','i','l') # define c3__nil c3_s3('n','i','l')
# define c3__nilk c3_s4('n','i','l','k') # define c3__nilk c3_s4('n','i','l','k')
# define c3__no c3_s2('n','o') # define c3__no c3_s2('n','o')
@ -736,6 +747,7 @@
# define c3__nop c3_s3('n','o','p') # define c3__nop c3_s3('n','o','p')
# define c3__noop c3_s4('n','o','o','p') # define c3__noop c3_s4('n','o','o','p')
# define c3__norm c3_s4('n','o','r','m') # define c3__norm c3_s4('n','o','r','m')
# define c3__nost c3_s4('n','o','s','t')
# define c3__not c3_s3('n','o','t') # define c3__not c3_s3('n','o','t')
# define c3__note c3_s4('n','o','t','e') # define c3__note c3_s4('n','o','t','e')
# define c3__noun c3_s4('n','o','u','n') # define c3__noun c3_s4('n','o','u','n')
@ -775,10 +787,12 @@
# define c3__pass c3_s4('p','a','s','s') # define c3__pass c3_s4('p','a','s','s')
# define c3__past c3_s4('p','a','s','t') # define c3__past c3_s4('p','a','s','t')
# define c3__peek c3_s4('p','e','e','k') # define c3__peek c3_s4('p','e','e','k')
# define c3__peep c3_s4('p','e','e','p')
# define c3__peft c3_s4('p','e','f','t') # define c3__peft c3_s4('p','e','f','t')
# define c3__peg c3_s3('p','e','g') # define c3__peg c3_s3('p','e','g')
# define c3__peld c3_s4('p','e','l','d') # define c3__peld c3_s4('p','e','l','d')
# define c3__pen c3_s3('p','e','n') # define c3__pen c3_s3('p','e','n')
# define c3__per c3_s3('p','e','r')
# define c3__perd c3_s4('p','e','r','d') # define c3__perd c3_s4('p','e','r','d')
# define c3__pesk c3_s4('p','e','s','k') # define c3__pesk c3_s4('p','e','s','k')
# define c3__pfix c3_s4('p','f','i','x') # define c3__pfix c3_s4('p','f','i','x')
@ -993,6 +1007,7 @@
# define c3__spig c3_s4('s','p','i','g') # define c3__spig c3_s4('s','p','i','g')
# define c3__spil c3_s4('s','p','i','l') # define c3__spil c3_s4('s','p','i','l')
# define c3__spin c3_s4('s','p','i','n') # define c3__spin c3_s4('s','p','i','n')
# define c3__spit c3_s4('s','p','i','t')
# define c3__spot c3_s4('s','p','o','t') # define c3__spot c3_s4('s','p','o','t')
# define c3__stam c3_s4('s','t','a','m') # define c3__stam c3_s4('s','t','a','m')
# define c3__star c3_s4('s','t','a','r') # define c3__star c3_s4('s','t','a','r')
@ -1094,6 +1109,7 @@
# define c3__tsgl c3_s4('t','s','g','l') # define c3__tsgl c3_s4('t','s','g','l')
# define c3__tsgr c3_s4('t','s','g','r') # define c3__tsgr c3_s4('t','s','g','r')
# define c3__tshp c3_s4('t','s','h','p') # define c3__tshp c3_s4('t','s','h','p')
# define c3__tshx c3_s4('t','s','h','x')
# define c3__tsls c3_s4('t','s','l','s') # define c3__tsls c3_s4('t','s','l','s')
# define c3__tsms c3_s4('t','s','m','s') # define c3__tsms c3_s4('t','s','m','s')
# define c3__tssg c3_s4('t','s','s','g') # define c3__tssg c3_s4('t','s','s','g')
@ -1107,7 +1123,7 @@
# define c3__tupl c3_s4('t','u','p','l') # define c3__tupl c3_s4('t','u','p','l')
# define c3__turd c3_s4('t','u','r','d') # define c3__turd c3_s4('t','u','r','d')
# define c3__turn c3_s4('t','u','r','n') # define c3__turn c3_s4('t','u','r','n')
# define c3__twin c3_s4('t','w','i','n') # define c3__twig c3_s4('t','w','i','g')
# define c3__twix c3_s4('t','w','i','x') # define c3__twix c3_s4('t','w','i','x')
# define c3__txt c3_s3('t','x','t') # define c3__txt c3_s3('t','x','t')
# define c3__type c3_s4('t','y','p','e') # define c3__type c3_s4('t','y','p','e')
@ -1143,6 +1159,7 @@
# define c3__vint c3_s4('v','i','n','t') # define c3__vint c3_s4('v','i','n','t')
# define c3__void c3_s4('v','o','i','d') # define c3__void c3_s4('v','o','i','d')
# define c3__vorp c3_s4('v','o','r','p') # define c3__vorp c3_s4('v','o','r','p')
# define c3__way c3_s3('w','a','y')
# define c3__wail c3_s4('w','a','i','l') # define c3__wail c3_s4('w','a','i','l')
# define c3__wake c3_s4('w','a','k','e') # define c3__wake c3_s4('w','a','k','e')
# define c3__wamp c3_s4('w','a','m','p') # define c3__wamp c3_s4('w','a','m','p')
@ -1160,6 +1177,7 @@
# define c3__wild c3_s4('w','i','l','d') # define c3__wild c3_s4('w','i','l','d')
# define c3__win c3_s3('w','i','n') # define c3__win c3_s3('w','i','n')
# define c3__wipe c3_s4('w','i','p','e') # define c3__wipe c3_s4('w','i','p','e')
# define c3__wish c3_s4('w','i','s','h')
# define c3__with c3_s4('w','i','t','h') # define c3__with c3_s4('w','i','t','h')
# define c3__wnut c3_s4('w','n','u','t') # define c3__wnut c3_s4('w','n','u','t')
# define c3__wood c3_s4('w','o','o','d') # define c3__wood c3_s4('w','o','o','d')

View File

@ -75,6 +75,11 @@
u3_weak u3_weak
u3kdi_put(u3_noun a, u3_noun b); u3kdi_put(u3_noun a, u3_noun b);
/* u3kdi_uni(): set union.
*/
u3_noun
u3kdi_uni(u3_noun a, u3_noun b);
# define u3kdb_tap(a, b) u3kdi_tap(a, b) # define u3kdb_tap(a, b) u3kdi_tap(a, b)
/* u3ke: tier 5 functions /* u3ke: tier 5 functions
@ -89,8 +94,17 @@
u3_atom u3_atom
u3ke_jam(u3_noun a); u3ke_jam(u3_noun a);
/* u3ke_trip: atom to tape. /* u3ke_trip(): atom to tape.
*/ */
u3_noun u3_noun
u3ke_trip(u3_noun a); u3ke_trip(u3_noun a);
/* u3kf_fork(): build %fork span.
*/
u3_noun
u3kf_fork(u3_noun yed);
/* u3kfu_repo():
*/
u3_noun
u3kfu_repo(u3_noun, u3_noun);

View File

@ -171,7 +171,9 @@
u3_noun u3qf_flay(u3_noun); u3_noun u3qf_flay(u3_noun);
u3_noun u3qf_flip(u3_noun); u3_noun u3qf_flip(u3_noun);
u3_noun u3qf_flor(u3_noun, u3_noun); u3_noun u3qf_flor(u3_noun, u3_noun);
u3_noun u3qf_fork(u3_noun, u3_noun); u3_noun u3qf_forq(u3_noun, u3_noun);
u3_noun u3qf_fork(u3_noun);
u3_noun u3qf_grof(u3_noun);
u3_noun u3qf_hike(u3_noun, u3_noun); u3_noun u3qf_hike(u3_noun, u3_noun);
u3_noun u3qf_look(u3_noun, u3_noun); u3_noun u3qf_look(u3_noun, u3_noun);
u3_noun u3qf_slot(u3_atom, u3_noun); u3_noun u3qf_slot(u3_atom, u3_noun);
@ -192,7 +194,7 @@
# define u3qfu_van_fab 119 # define u3qfu_van_fab 119
u3_noun u3qfu_burn(u3_noun, u3_noun); u3_noun u3qfu_burn(u3_noun, u3_noun);
u3_noun u3qfu_busk(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_buss(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_bust(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_bust(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_conk(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_conk(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_crop(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_crop(u3_noun, u3_noun, u3_noun);
@ -200,8 +202,9 @@
u3_noun u3qfu_duck(u3_noun, u3_noun); u3_noun u3qfu_duck(u3_noun, u3_noun);
u3_noun u3qfu_dung(u3_noun, u3_noun cap, u3_noun); u3_noun u3qfu_dung(u3_noun, u3_noun cap, u3_noun);
u3_noun u3qfu_dunq(u3_noun, const c3_c*, u3_noun); u3_noun u3qfu_dunq(u3_noun, const c3_c*, u3_noun);
u3_noun u3qfu_find(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); void u3qfu_dump(u3_noun, const c3_c*, u3_noun);
u3_noun u3qfu_fino(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_fond(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_fire(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_fire(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_firm(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_firm(u3_noun, u3_noun, u3_noun);
@ -213,18 +216,17 @@
u3_noun u3qfu_mint(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_mint(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_mull(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_mull(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_nest(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_nest(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_nost(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_orth(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_orth(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_park(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_park(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_peek(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_peek(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_play(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_play(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_repo(u3_noun, u3_noun); u3_noun u3qfu_repo(u3_noun, u3_noun);
u3_noun u3qfu_rest(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_rest(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_seek(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_seep(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_shep(u3_noun, const c3_c*, u3_noun, u3_noun); u3_noun u3qfu_shep(u3_noun, const c3_c*, u3_noun, u3_noun);
u3_noun u3qfu_shew(u3_noun, u3_noun); u3_noun u3qfu_shew(u3_noun, u3_noun);
u3_noun u3qfu_sift(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_sift(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_snub(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_snub(u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_tack(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_tack(u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_tock(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_toss(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
u3_noun u3qfu_wrap(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_wrap(u3_noun, u3_noun, u3_noun);

View File

@ -200,6 +200,7 @@
u3_noun u3wf_flay(u3_noun); u3_noun u3wf_flay(u3_noun);
u3_noun u3wf_flip(u3_noun); u3_noun u3wf_flip(u3_noun);
u3_noun u3wf_flor(u3_noun); u3_noun u3wf_flor(u3_noun);
u3_noun u3wf_forq(u3_noun);
u3_noun u3wf_fork(u3_noun); u3_noun u3wf_fork(u3_noun);
u3_noun u3wf_hike(u3_noun); u3_noun u3wf_hike(u3_noun);
u3_noun u3wf_look(u3_noun); u3_noun u3wf_look(u3_noun);
@ -220,7 +221,7 @@
u3_noun u3wfu_cull(u3_noun); u3_noun u3wfu_cull(u3_noun);
u3_noun u3wfu_duck(u3_noun); u3_noun u3wfu_duck(u3_noun);
u3_noun u3wfu_find(u3_noun); u3_noun u3wfu_find(u3_noun);
u3_noun u3wfu_fino(u3_noun); u3_noun u3wfu_fond(u3_noun);
u3_noun u3wfu_fink(u3_noun); u3_noun u3wfu_fink(u3_noun);
u3_noun u3wfu_fire(u3_noun); u3_noun u3wfu_fire(u3_noun);
u3_noun u3wfu_firm(u3_noun); u3_noun u3wfu_firm(u3_noun);
@ -235,10 +236,8 @@
u3_noun u3wfu_play(u3_noun); u3_noun u3wfu_play(u3_noun);
u3_noun u3wfu_repo(u3_noun); u3_noun u3wfu_repo(u3_noun);
u3_noun u3wfu_rest(u3_noun); u3_noun u3wfu_rest(u3_noun);
u3_noun u3wfu_seek(u3_noun);
u3_noun u3wfu_seep(u3_noun);
u3_noun u3wfu_snub(u3_noun); u3_noun u3wfu_snub(u3_noun);
u3_noun u3wfu_tock(u3_noun); u3_noun u3wfu_toss(u3_noun);
u3_noun u3wfu_wrap(u3_noun); u3_noun u3wfu_wrap(u3_noun);

View File

@ -14,6 +14,7 @@
* U3_MEMORY_DEBUG is on, this should generally be on as well. * U3_MEMORY_DEBUG is on, this should generally be on as well.
*/ */
# undef U3_CELLOC_TOGGLE # undef U3_CELLOC_TOGGLE
/* U3_PRINT_WATERMARK: print watermark information for each road /* U3_PRINT_WATERMARK: print watermark information for each road
*/ */
# undef U3_PRINT_WATERMARK # undef U3_PRINT_WATERMARK
@ -145,7 +146,7 @@
} jed; } jed;
struct { // namespace struct { // namespace
u3_noun flu; // (list $+(* (unit))), inward u3_noun gul; // (list $+(* (unit (unit)))) now
} ski; } ski;
struct { // trace stack struct { // trace stack

View File

@ -71,7 +71,7 @@
/* u3m_soft_run(): descend into virtualization context. /* u3m_soft_run(): descend into virtualization context.
*/ */
u3_noun u3_noun
u3m_soft_run(u3_noun fly, u3m_soft_run(u3_noun gul,
u3_funq fun_f, u3_funq fun_f,
u3_noun aga, u3_noun aga,
u3_noun agb); u3_noun agb);
@ -79,7 +79,7 @@
/* u3m_soft_esc(): namespace lookup to (unit ,*). /* u3m_soft_esc(): namespace lookup to (unit ,*).
*/ */
u3_noun u3_noun
u3m_soft_esc(u3_noun sam); u3m_soft_esc(u3_noun ref, u3_noun sam);
/* u3m_mark(): mark all nouns in the road. /* u3m_mark(): mark all nouns in the road.
*/ */

View File

@ -19,26 +19,36 @@
u3_noun u3_noun
u3n_kick_on(u3_noun gat); u3n_kick_on(u3_noun gat);
/* u3n_nock_un(): produce .*(bus fol), as ++toon.
*/
u3_noun
u3n_nock_un(u3_noun bus, u3_noun fol);
/* u3n_slam_un(): produce (gat sam), as ++toon.
*/
u3_noun
u3n_slam_un(u3_noun gat, u3_noun sam);
/* u3n_nock_in(): produce .*(bus fol), as ++toon, in namespace. /* u3n_nock_in(): produce .*(bus fol), as ++toon, in namespace.
*/ */
u3_noun u3_noun
u3n_nock_in(u3_noun fly, u3_noun bus, u3_noun fol); u3n_nock_in(u3_noun fly, u3_noun bus, u3_noun fol);
/* u3n_nock_it(): produce .*(bus fol), as ++toon, in namespace.
*/
u3_noun
u3n_nock_it(u3_noun sea, u3_noun bus, u3_noun fol);
/* u3n_nock_et(): produce .*(bus fol), as ++toon, in namespace.
*/
u3_noun
u3n_nock_et(u3_noun gul, u3_noun bus, u3_noun fol);
/* u3n_slam_in(): produce (gat sam), as ++toon, in namespace. /* u3n_slam_in(): produce (gat sam), as ++toon, in namespace.
*/ */
u3_noun u3_noun
u3n_slam_in(u3_noun fly, u3_noun gat, u3_noun sam); u3n_slam_in(u3_noun fly, u3_noun gat, u3_noun sam);
/* u3n_slam_it(): produce (gat sam), as ++toon, in namespace.
*/
u3_noun
u3n_slam_it(u3_noun sea, u3_noun gat, u3_noun sam);
/* u3n_slam_et(): produce (gat sam), as ++toon, in namespace.
*/
u3_noun
u3n_slam_it(u3_noun gul, u3_noun gat, u3_noun sam);
/* u3n_nock_an(): as slam_in(), but with empty fly. /* u3n_nock_an(): as slam_in(), but with empty fly.
*/ */
u3_noun u3_noun

View File

@ -17,6 +17,8 @@
# define u3x_sam_12 52 # define u3x_sam_12 52
# define u3x_sam_13 53 # define u3x_sam_13 53
# define u3x_sam_7 27 # define u3x_sam_7 27
# define u3x_sam_14 54
# define u3x_sam_15 55
# define u3x_con 7 // context # define u3x_con 7 // context
# define u3x_con_2 14 // context # define u3x_con_2 14 // context
# define u3x_con_3 15 // context # define u3x_con_3 15 // context

View File

@ -6,6 +6,17 @@
/* functions /* functions
*/ */
u3_noun
u3kdi_uni(u3_noun a,
u3_noun b)
{
u3_noun c = u3qdi_uni(a, b);
u3z(a);
u3z(b);
return c;
}
u3_noun u3_noun
u3qdi_uni(u3_noun a, u3qdi_uni(u3_noun a,
u3_noun b) u3_noun b)
@ -36,56 +47,58 @@
} }
else if ( c3y == u3r_sing(n_a, n_b) ) { else if ( c3y == u3r_sing(n_a, n_b) ) {
return u3nt(u3k(n_b), return u3nt(u3k(n_b),
u3qdi_uni(u3k(l_a), u3k(l_b)), u3kdi_uni(u3k(l_a), u3k(l_b)),
u3qdi_uni(u3k(r_a), u3k(r_b))); u3kdi_uni(u3k(r_a), u3k(r_b)));
} }
else if ( c3y == u3qc_hor(n_b, n_a) ) { else if ( c3y == u3qc_hor(n_b, n_a) ) {
return u3qdi_uni(u3nt(u3k(n_a), return u3kdi_uni(u3nt(u3k(n_a),
u3qdi_uni(u3k(l_a), u3kdi_uni(u3k(l_a),
u3nt(u3k(n_b), u3nt(u3k(n_b),
u3k(l_b), u3k(l_b),
u3k(u3_nul))), u3_nul)),
u3k(r_a)), u3k(r_a)),
u3k(r_b)); u3k(r_b));
} }
else { else {
return u3qdi_uni(u3nt(u3k(n_a), return u3kdi_uni(u3nt(u3k(n_a),
u3k(l_a), u3k(l_a),
u3qdi_uni(u3k(r_a), u3kdi_uni(u3k(r_a),
u3nt(u3k(n_b), u3nt(u3k(n_b),
u3k(u3_nul), u3_nul,
u3k(r_b)))), u3k(r_b)))),
u3k(l_b)); u3k(l_b));
} }
} }
else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) {
return u3m_bail(c3__exit);
}
else if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) {
return u3m_bail(c3__exit);
}
else if ( c3y == u3r_sing(n_b, n_a) ) {
return u3nt(u3k(n_b),
u3qdi_uni(u3k(r_b), u3k(r_a)),
u3qdi_uni(u3k(l_b), u3k(l_a)));
}
else if ( c3y == u3qc_hor(n_a, n_b) ) {
return u3qdi_uni(u3k(r_a),
u3nt(u3k(n_b),
u3qdi_uni(u3nt(u3k(n_a),
u3k(l_a),
u3_nul),
u3k(l_b)),
u3k(r_b)));
}
else { else {
return u3qdi_uni(u3k(l_a), if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) {
u3nt(u3k(n_b), return u3m_bail(c3__exit);
u3k(l_b), }
u3qdi_uni(u3nt(u3k(n_a), else if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) {
u3k(u3_nul), return u3m_bail(c3__exit);
u3k(r_a)), }
u3k(r_b)))); else if ( c3y == u3r_sing(n_b, n_a) ) {
return u3nt(u3k(n_b),
u3kdi_uni(u3k(l_a), u3k(l_b)),
u3kdi_uni(u3k(r_a), u3k(r_b)));
}
else if ( c3y == u3qc_hor(n_a, n_b) ) {
return u3kdi_uni(u3k(r_a),
u3nt(u3k(n_b),
u3kdi_uni(u3nt(u3k(n_a),
u3k(l_a),
u3_nul),
u3k(l_b)),
u3k(r_b)));
}
else {
return u3kdi_uni(u3k(l_a),
u3nt(u3k(n_b),
u3k(l_b),
u3kdi_uni(u3nt(u3k(n_a),
u3_nul,
u3k(r_a)),
u3k(r_b))));
}
} }
} }
} }

View File

@ -3,15 +3,14 @@
*/ */
#include "all.h" #include "all.h"
u3_noun u3_noun
u3we_mink(u3_noun cor) u3we_mink(u3_noun cor)
{ {
u3_noun bus, fol, fly; u3_noun bus, fol, gul;
if ( c3n == u3r_mean(cor, u3x_sam_4, &bus, if ( c3n == u3r_mean(cor, u3x_sam_4, &bus,
u3x_sam_5, &fol, u3x_sam_5, &fol,
u3x_sam_3, &fly, u3x_sam_3, &gul,
0) ) 0) )
{ {
return u3m_bail(c3__exit); return u3m_bail(c3__exit);
@ -19,7 +18,7 @@
else { else {
u3_noun som; u3_noun som;
som = u3n_nock_in(u3k(fly), u3k(bus), u3k(fol)); som = u3n_nock_et(u3k(gul), u3k(bus), u3k(fol));
return som; return som;
} }

View File

@ -21,7 +21,18 @@
static u3_noun static u3_noun
_open_in(u3_noun ter, u3_noun gen); _open_in(u3_noun ter, u3_noun gen);
#if 0
/* ~(. al gen)
*/
static u3_noun
_al_bore(u3_noun ter,
u3_noun gen)
{
u3_noun gat = u3j_hook(u3k(ter), "al");
return u3i_molt(gat, u3x_sam, u3nc(c3__herb, u3k(gen)), 0);
}
#endif
/* ~(. al gen) /* ~(. al gen)
*/ */
static u3_noun static u3_noun
@ -476,12 +487,14 @@
u3nq(c3__cnhp, u3k(p_gen), u3k(q_gen), u3_nul), u3nq(c3__cnhp, u3k(p_gen), u3k(q_gen), u3_nul),
u3k(q_gen)); u3k(q_gen));
} }
#if 0
_open_do_pq(kthp) // ^- _open_do_pq(kthp) // ^-
{ {
return u3nt(c3__ktls, return u3nt(c3__ktls,
_ap_bunt(_al_core(ter, p_gen), p_gen), _ap_bunt(_al_bore(ter, p_gen), p_gen),
u3k(q_gen)); u3k(q_gen));
} }
#endif
/*** /***
**** ****
***/ ***/
@ -702,6 +715,8 @@
{ {
u3_noun p_gen, q_gen, r_gen, s_gen; u3_noun p_gen, q_gen, r_gen, s_gen;
return u3_none;
if ( c3y == u3ud(gen) ) { if ( c3y == u3ud(gen) ) {
// printf("studly\n"); // printf("studly\n");
// u3_err("stud m", gen); // u3_err("stud m", gen);
@ -776,7 +791,7 @@
_open_p (hxgr); _open_p (hxgr);
_open_pq (ktdt); _open_pq (ktdt);
_open_pq (kthp); // _open_pq (kthp);
_open_pq (sgts); _open_pq (sgts);
// _open_pq (sgbr); // _open_pq (sgbr);

View File

@ -1,31 +0,0 @@
/* j/6/bull.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qf_bull(u3_noun bid,
u3_noun der)
{
if ( (c3__void == der) ||
(c3__void == u3t(u3t(u3t(bid)))) )
{
return c3__void;
}
else return u3nt
(c3__bull, u3k(bid), u3k(der));
}
u3_noun
u3wf_bull(u3_noun cor)
{
u3_noun bid, der;
if ( c3n == u3r_mean(cor, u3x_sam_2, &bid, u3x_sam_3, &der, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_bull(bid, der);
}
}

View File

@ -1,30 +0,0 @@
/* j/6/cube.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qf_cube(u3_noun dil,
u3_noun goq)
{
if ( c3__void == goq ) {
return c3__void;
}
else return u3nt(c3__cube,
u3k(dil),
u3k(goq));
}
u3_noun
u3wf_cube(u3_noun cor)
{
u3_noun dil, goq;
if ( c3n == u3r_mean(cor, u3x_sam_2, &dil, u3x_sam_3, &goq, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_cube(dil, goq);
}
}

View File

@ -7,24 +7,25 @@
/* functions /* functions
*/ */
u3_noun u3_noun
u3qf_face(u3_noun cog, u3qf_face(u3_noun sag,
u3_noun tip) u3_noun tip)
{ {
if ( c3__void == tip ) { if ( c3__void == tip ) {
return c3__void; return c3__void;
} }
else return u3nt(c3__face, else return u3nt(c3__face,
u3k(cog), u3k(sag),
u3k(tip)); u3k(tip));
} }
u3_noun u3_noun
u3wf_face(u3_noun cor) u3wf_face(u3_noun cor)
{ {
u3_noun cog, tip; u3_noun sag, tip;
if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &tip, 0) ) { if ( c3n == u3r_mean(cor, u3x_sam_2, &sag, u3x_sam_3, &tip, 0) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} else { } else {
return u3qf_face(cog, tip); return u3qf_face(sag, tip);
} }
} }

View File

@ -1,52 +0,0 @@
/* j/6/flay.c
**
*/
#include "all.h"
/* functions
*/
static u3_noun
_flay_roll(u3_noun quz)
{
if ( c3n == u3du(quz) ) {
return c3__void;
} else {
u3_noun voo = _flay_roll(u3t(quz));
u3_noun oon = u3qf_fork(u3h(u3h(quz)), voo);
u3z(voo);
return oon;
}
}
u3_noun
u3qf_flay(u3_noun pok)
{
u3_noun p_pok = u3h(pok);
u3_noun q_pok = u3t(pok);
u3_noun typ;
switch ( u3h(q_pok) ) {
default: return u3m_bail(c3__fail);
case c3y: typ = u3k(u3t(q_pok));
break;
case c3n: typ = _flay_roll(u3t(u3t(q_pok)));
break;
}
return u3nc(u3k(p_pok), typ);
}
u3_noun
u3wf_flay(u3_noun cor)
{
u3_noun pok;
if ( (c3n == u3r_mean(cor, u3x_sam, &pok, 0)) ||
(c3n == u3du(pok)) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_flay(pok);
}
}

View File

@ -7,7 +7,7 @@
/* functions /* functions
*/ */
u3_noun u3_noun
u3qf_fork(u3_noun hoz, u3qf_forq(u3_noun hoz,
u3_noun bur) u3_noun bur)
{ {
if ( c3y == u3r_sing(hoz, bur) ) { if ( c3y == u3r_sing(hoz, bur) ) {
@ -19,17 +19,60 @@
else if ( c3__void == hoz ) { else if ( c3__void == hoz ) {
return u3k(bur); return u3k(bur);
} }
else return u3nt else return u3kf_fork(u3nt(u3k(hoz), u3k(bur), u3_nul));
(c3__fork, u3k(hoz), u3k(bur));
} }
u3_noun
u3qf_fork(u3_noun yed)
{
u3_noun lez = u3_nul;
while ( u3_nul != yed ) {
u3_noun i_yed = u3h(yed);
if ( c3__void != i_yed ) {
if ( (c3y == u3du(i_yed)) && (c3__fork == u3h(i_yed)) ) {
lez = u3kdi_uni(lez, u3k(u3t(i_yed)));
}
else {
lez = u3kdi_put(lez, u3k(i_yed));
}
}
yed = u3t(yed);
}
if ( u3_nul == lez ) {
return c3__void;
}
else if ( (u3_nul == u3h(u3t(lez))) && (u3_nul == u3t(u3t(lez))) ) {
u3_noun ret = u3k(u3h(lez));
u3z(lez);
return ret;
}
else {
return u3nc(c3__fork, lez);
}
}
u3_noun u3_noun
u3wf_fork(u3_noun cor) u3wf_fork(u3_noun cor)
{ {
u3_noun hoz, bur; u3_noun yed;
if ( c3n == u3r_mean(cor, u3x_sam_2, &hoz, u3x_sam_3, &bur, 0) ) { if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} else { } else {
return u3qf_fork(hoz, bur); return u3qf_fork(yed);
} }
} }
u3_noun
u3kf_fork(u3_noun yed)
{
u3_noun ret = u3qf_fork(yed);
u3z(yed);
return ret;
}

View File

@ -20,7 +20,7 @@
else switch ( u3h(sut) ) { else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__atom: p_sut = u3t(sut); case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
} }
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
@ -29,13 +29,10 @@
case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
} }
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
} }
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__fork: p_sut = u3t(sut);
{ {
} }
case c3__hold: p_sut = u3t(sut); case c3__hold: p_sut = u3t(sut);

View File

@ -3,6 +3,9 @@
*/ */
#include "all.h" #include "all.h"
extern void
u3_lo_tank(c3_l tab_l, u3_noun tac);
// duck: create a duck core for mean. // duck: create a duck core for mean.
// //
@ -51,6 +54,22 @@
return ret; return ret;
} }
// dump: dump a type.
//
void
u3qfu_dump(u3_noun van,
const c3_c* paz_c,
u3_noun typ)
{
c3_c* pfix_c = u3r_string((c3y == u3du(typ)) ? u3h(typ) : typ);
c3_c ugh_c[1024];
sprintf(ugh_c, "%s: %s: 0x%8x:",
paz_c, pfix_c, u3r_mug(typ));
u3_lo_tank(0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ)));
}
// shew: create a show core for mean // shew: create a show core for mean
// //
u3_noun u3_noun

View File

@ -6,6 +6,48 @@
/* logic /* logic
*/ */
static u3_noun
_burn_in(u3_noun van, u3_noun sut, u3_noun gil);
static u3_noun
_burn_fork(u3_noun van,
u3_noun yed,
u3_noun gil)
{
if ( u3_nul == yed ) {
return u3_nul;
} else {
u3_noun dis = _burn_in(van, u3h(yed), gil);
u3_noun mor = _burn_fork(van, u3t(yed), gil);
if ( u3_nul == dis ) return mor;
if ( u3_nul == mor ) return dis;
{
u3_noun u_dis = u3t(dis);
u3_noun u_mor = u3t(mor);
if ( u3du(u_dis) == u3du(u_mor) ) {
if ( c3y == u3qc_gor(u_mor, u_dis) ) {
u3z(dis);
return mor;
} else {
u3z(mor);
return dis;
}
} else {
if ( c3y == u3ud(u_dis) ) {
u3z(mor);
return dis;
}
else {
u3z(dis);
return mor;
}
}
}
}
}
static u3_noun static u3_noun
_burn_in(u3_noun van, _burn_in(u3_noun van,
u3_noun sut, u3_noun sut,
@ -16,52 +58,77 @@
if ( c3n == u3du(sut) ) switch ( sut ) { if ( c3n == u3du(sut) ) switch ( sut ) {
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__noun: return 0; case c3__noun: return u3nc(u3_nul, 0);
case c3__void: { case c3__void: {
return u3m_error("burn-void"); return u3_nul;
} }
} }
else switch ( u3h(sut) ) { else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__atom: return 0; case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut);
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
return _burn_in(van, q_sut, gil); if ( c3y == u3du(q_sut) ) {
return u3nc(u3_nul, u3k(u3t(q_sut)));
} else {
return u3nc(u3_nul, 0);
}
} }
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
return u3nc u3_noun hed = _burn_in(van, p_sut, gil);
(_burn_in(van, p_sut, gil),
_burn_in(van, q_sut, gil)); if ( u3_nul == hed ) {
return u3_nul;
}
else {
u3_noun tal = _burn_in(van, q_sut, gil);
if ( u3_nul == tal ) {
u3z(hed);
return u3_nul;
}
else {
u3_noun ret = u3nt(u3_nul, u3k(u3t(hed)), u3k(u3t(tal)));
u3z(hed);
u3z(tal);
return ret;
}
}
} }
case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut);
u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut);
u3x_cell(rq_sut, &prq_sut, &qrq_sut); u3x_cell(rq_sut, &prq_sut, &qrq_sut);
{ {
return u3nc u3_noun pay = _burn_in(van, p_sut, gil);
(u3k(prq_sut),
_burn_in(van, p_sut, gil)); if ( u3_nul == pay ) {
} return u3_nul;
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut); }
{ else {
return u3k(p_sut); u3_noun ret = u3nt(u3_nul, u3k(prq_sut), u3k(u3t(pay)));
u3z(pay);
return ret;
}
} }
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
return _burn_in(van, q_sut, gil); return _burn_in(van, q_sut, gil);
} }
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__fork: p_sut = u3t(sut);
{ {
return _burn_in(van, p_sut, gil); u3_noun yed = u3qdi_tap(p_sut, u3_nul);
u3_noun ret = _burn_fork(van, yed, gil);
u3z(yed);
return ret;
} }
case c3__hold: p_sut = u3t(sut); case c3__hold:
{ {
if ( (c3y == u3qdi_has(gil, sut)) ) { if ( (c3y == u3qdi_has(gil, sut)) ) {
u3_noun sux = u3qfu_dunq(van, "type", sut); return u3_nul;
u3t_push(u3nc(c3__mean, sux));
return u3m_error("burn-loop");
} }
else { else {
u3_noun zoc = u3qdi_put(gil, sut); u3_noun zoc = u3qdi_put(gil, sut);
@ -81,14 +148,24 @@
_cqfu_burn(u3_noun van, _cqfu_burn(u3_noun van,
u3_noun sut) u3_noun sut)
{ {
return _burn_in(van, sut, u3_nul); u3_noun unt = _burn_in(van, sut, u3_nul);
if ( u3_nul == unt ) {
return u3m_error("burn");
}
else {
u3_noun ret = u3k(u3t(unt));
u3z(unt);
return ret;
}
} }
u3_noun u3_noun
u3qfu_burn(u3_noun van, u3qfu_burn(u3_noun van,
u3_noun sut) u3_noun sut)
{ {
c3_m fun_m = c3__burn; c3_m fun_m = c3__burn + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find(fun_m, sut); u3_noun pro = u3z_find(fun_m, sut);
if ( u3_none != pro ) { if ( u3_none != pro ) {

View File

@ -1,51 +0,0 @@
/* j/6/ut_busk.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_busk(u3_noun van,
u3_noun sut,
u3_noun cog,
u3_noun hyp)
{
u3_noun sep = u3qfu_seep(van, sut, c3__both, hyp);
u3_noun bid = u3nt(u3k(cog), u3k(hyp), sep);
u3_noun ret = u3qf_bull(bid, sut);
u3z(bid);
return ret;
}
/* boilerplate
*/
u3_noun
u3wfu_busk(u3_noun cor)
{
u3_noun sut, cog, hyp, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &cog,
u3x_sam_3, &hyp,
u3x_con, &van,
0)) ||
(c3n == u3ud(cog)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_busk(van, sut, cog, hyp);
}
}
u3_noun
u3qfu_busk(u3_noun van,
u3_noun sut,
u3_noun cog,
u3_noun hyp)
{
return _cqfu_busk(van, sut, cog, hyp);
}

53
jets/f/ut_buss.c Normal file
View File

@ -0,0 +1,53 @@
/* j/6/ut_buss.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_buss(u3_noun van,
u3_noun sut,
u3_noun cog,
u3_noun gen)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "buss");
return u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(cog),
u3x_sam_3,
u3k(gen),
0));
}
/* boilerplate
*/
u3_noun
u3wfu_buss(u3_noun cor)
{
u3_noun sut, cog, gen, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &cog,
u3x_sam_3, &gen,
u3x_con, &van,
0)) ||
(c3n == u3ud(cog)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_buss(van, sut, cog, gen);
}
}
u3_noun
u3qfu_buss(u3_noun van,
u3_noun sut,
u3_noun cog,
u3_noun gen)
{
return _cqfu_buss(van, sut, cog, gen);
}

View File

@ -1,68 +0,0 @@
/* j/6/bust.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_bust(u3_noun van,
u3_noun sut,
u3_noun dib)
{
u3_noun yam = u3qfu_burn(van, sut);
u3_noun yib = u3nc(u3nc(u3k(u3h(u3h(yam))),
u3k(dib)),
u3k(u3t(yam)));
u3_noun woo = u3nc(c3__cnzy, u3_blip);
u3_noun wox = u3qfu_mint(van, sut, c3__noun, woo);
u3_noun ret = u3n_nock_on(yib, u3k(u3t(wox)));
if ( u3_none == ret ) {
return u3m_error("bust-nock");
}
u3z(wox);
u3z(woo);
u3z(yam);
return ret;
}
/* boilerplate
*/
u3_noun
u3wfu_bust(u3_noun cor)
{
u3_noun sut, dib, van;
if ( (c3n == u3r_mean(cor, u3x_sam, &dib, u3x_con, &van, 0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_bust(van, sut, dib);
}
}
u3_noun
u3qfu_bust(u3_noun van,
u3_noun sut,
u3_noun dib)
{
#if 1
return _cqfu_bust(van, sut, dib);
#else
c3_m fun_m = c3__bust;
u3_noun pro = u3z_find_2(fun_m, sut, dib);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqfu_bust(van, sut, dib);
return u3z_save_2(fun_m, sut, dib, pro);
}
#endif
}

View File

@ -3,7 +3,6 @@
*/ */
#include "all.h" #include "all.h"
/* logic /* logic
*/ */
static u3_noun static u3_noun
@ -34,6 +33,32 @@
} }
} }
static u3_noun
_crop_dext_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_crop_dext(van, u3h(p_sut), ref, bix),
_crop_dext_fork(van, u3t(p_sut), ref, bix));
}
}
static u3_noun
_crop_sint_fork(u3_noun van, u3_noun sut, u3_noun p_ref, u3_noun bix)
{
if ( u3_nul == p_ref ) {
return u3k(sut);
}
else {
u3_noun tuz = _crop_dext(van, sut, u3h(p_ref), bix);
u3_noun zat = _crop_sint_fork(van, tuz, u3t(p_ref), bix);
u3z(tuz);
return zat;
}
}
static u3_noun static u3_noun
_crop_dext(u3_noun van, _crop_dext(u3_noun van,
u3_noun sut, u3_noun sut,
@ -61,24 +86,34 @@
else switch ( u3h(sut) ) { else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__atom: case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
if ( c3__atom == u3h(ref) ) { if ( c3__atom == u3h(ref) ) {
return c3__void; u3x_cell(u3t(ref), &p_ref, &q_ref);
if ( c3y == u3du(q_sut) ) {
if ( c3y == u3du(q_ref) ) {
if ( c3y == u3r_sing(q_sut, q_ref) ) {
return c3__void;
} else {
return u3k(sut);
}
} else {
return c3__void;
}
}
else {
if ( c3y == u3du(q_ref) ) {
return u3k(sut);
}
else return c3__void;
}
} }
else if ( c3__cell == u3h(ref) ) { else if ( c3__cell == u3h(ref) ) {
return u3k(sut); return u3k(sut);
} }
else return _crop_sint(van, sut, ref, bix); else return _crop_sint(van, sut, ref, bix);
} }
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
u3_noun ret = u3qf_bull(p_sut, foz);
u3z(foz);
return ret;
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
if ( c3__atom == u3h(ref) ) { if ( c3__atom == u3h(ref) ) {
@ -101,32 +136,12 @@
} }
case c3__core: case c3__core:
{ {
if ( (c3__atom == u3h(ref)) || (c3__cell == u3h(ref)) ) { if ( (c3__atom == u3h(ref)) ||
(c3__cell == u3h(ref)) ) {
return u3k(sut); return u3k(sut);
} }
else return _crop_sint(van, sut, ref, bix); else return _crop_sint(van, sut, ref, bix);
} }
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( (c3__cube == u3h(ref)) &&
(c3y == u3r_sing(p_sut, u3h(u3t(ref)))) )
{
return c3__void;
}
else if ( (c3__atom == u3h(ref)) || (c3__cell == u3h(ref)) ) {
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
u3_noun ret;
if ( c3y == u3qfu_firm(van, foz, p_sut) ) {
ret = u3qf_cube(p_sut, foz);
}
else ret = c3__void;
u3z(foz);
return ret;
}
else return _crop_sint(van, sut, ref, bix);
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
u3_noun foz = _crop_dext(van, q_sut, ref, bix); u3_noun foz = _crop_dext(van, q_sut, ref, bix);
@ -135,17 +150,15 @@
u3z(foz); u3z(foz);
return ret; return ret;
} }
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__fork: p_sut = u3t(sut);
{ {
u3_noun dis = _crop_dext(van, p_sut, ref, bix); u3_noun yed = u3qdi_tap(p_sut, u3_nul);
u3_noun dat = _crop_dext(van, q_sut, ref, bix); u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix));
u3_noun ret = u3qf_fork(dis, dat);
u3z(dis); u3z(yed);
u3z(dat);
return ret; return ret;
} }
case c3__hold: p_sut = u3t(sut); case c3__hold:
{ {
u3_noun hud = u3nc(u3k(sut), u3k(ref)); u3_noun hud = u3nc(u3k(sut), u3k(ref));
@ -182,27 +195,20 @@
switch ( u3h(ref) ) { switch ( u3h(ref) ) {
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__bull: u3x_cell(u3t(ref), &p_ref, &q_ref);
{
return _crop_dext(van, sut, q_ref, bix);
}
case c3__core: case c3__core:
case c3__cube: {
return u3k(sut);
}
case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref); case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref);
{ {
return _crop_dext(van, sut, q_ref, bix); return _crop_dext(van, sut, q_ref, bix);
} }
case c3__fork: u3x_cell(u3t(ref), &p_ref, &q_ref); case c3__fork: p_ref = u3t(ref);
{ {
u3_noun hin = _crop_dext(van, sut, p_ref, bix); u3_noun yed = u3qdi_tap(p_ref, u3_nul);
u3_noun ret = _crop_dext(van, hin, q_ref, bix); u3_noun ret = _crop_sint_fork(van, sut, yed, bix);
u3z(hin); u3z(yed);
return ret; return ret;
} }
case c3__hold: p_ref = u3t(ref); case c3__hold:
{ {
u3_noun rep = u3qfu_repo(van, ref); u3_noun rep = u3qfu_repo(van, ref);
u3_noun ret = _crop_dext(van, sut, rep, bix); u3_noun ret = _crop_dext(van, sut, rep, bix);
@ -242,7 +248,7 @@
u3_noun sut, u3_noun sut,
u3_noun ref) u3_noun ref)
{ {
c3_m fun_m = c3__crop; c3_m fun_m = c3__crop + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find_2(fun_m, sut, ref); u3_noun pro = u3z_find_2(fun_m, sut, ref);
if ( u3_none != pro ) { if ( u3_none != pro ) {

View File

@ -1,203 +0,0 @@
/* j/6/cull.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_cull(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_cull_in(u3_noun van,
u3_noun sut,
u3_noun pol,
u3_atom axe,
u3_noun ref,
u3_noun now,
u3_noun lat,
u3_noun vil)
{
u3_noun ret, p_sut, q_sut;
if ( c3n == u3du(sut) ) switch ( sut ) {
default: return u3m_bail(c3__fail);
case c3__noun: {
u3_noun pyr = u3qfu_repo(van, sut);
u3_noun yot = _cqfu_cull(van, pyr, pol, axe, ref);
if ( c3y == u3r_sing(pyr, yot) ) {
ret = u3k(sut);
} else {
ret = u3k(yot);
}
u3z(pyr);
u3z(yot);
break;
}
case c3__void: {
ret = c3__void;
}
}
else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail);
case c3__atom: {
ret = c3__void;
break;
}
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun hic = _cqfu_cull(van, q_sut, pol, axe, ref);
if ( c3y == u3r_sing(hic, q_sut) ) {
ret = u3k(sut);
} else {
ret = u3qf_bull(p_sut, hic);
}
u3z(hic);
break;
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun hub;
if ( 2 == now ) {
hub = _cqfu_cull(van, p_sut, pol, lat, ref);
ret = u3qf_cell(hub, q_sut);
} else {
hub = _cqfu_cull(van, q_sut, pol, lat, ref);
ret = u3qf_cell(p_sut, hub);
}
u3z(hub);
break;
}
case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( 3 != now ) {
ret = u3k(sut);
} else {
u3_noun hub = _cqfu_cull(van, p_sut, pol, lat, ref);
ret = u3qf_core(hub, q_sut);
u3z(hub);
}
break;
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun hic = _cqfu_cull(van, q_sut, pol, axe, ref);
if ( c3y == u3r_sing(hic, q_sut) ) {
ret = u3k(sut);
} else {
ret = u3qf_face(p_sut, hic);
}
u3z(hic);
break;
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( c3y == u3qdi_has(vil, sut) ) {
return c3__void;
} else {
u3_noun zoc = u3qdi_put(vil, sut);
u3_noun sin = _cull_in(van, p_sut, pol, axe, ref, now, lat, zoc);
u3_noun dex = _cull_in(van, q_sut, pol, axe, ref, now, lat, zoc);
ret = u3qf_fork(sin, dex);
u3z(sin);
u3z(dex);
u3z(zoc);
return ret;
}
}
case c3__cube:
case c3__hold:
{
u3_noun pyr = u3qfu_repo(van, sut);
u3_noun yot = _cull_in(van, pyr, pol, axe, ref, now, lat, vil);
if ( c3y == u3r_sing(pyr, yot) ) {
if ( c3__void == pyr ) {
ret = c3__void;
}
else ret = u3k(sut);
} else {
ret = u3k(yot);
}
u3z(pyr);
u3z(yot);
break;
}
}
u3z(lat);
return ret;
}
u3_noun
_cqfu_cull(u3_noun van,
u3_noun sut,
u3_noun pol,
u3_atom axe,
u3_noun ref)
{
if ( 1 == axe ) {
if ( c3y == pol ) {
return u3qfu_fuse(van, sut, ref);
} else {
return u3qfu_crop(van, sut, ref);
}
} else {
u3_atom now = u3qc_cap(axe);
u3_atom lat = u3qc_mas(axe);
return _cull_in(van, sut, pol, axe, ref, now, lat, u3_nul);
}
}
/* boilerplate
*/
u3_noun
u3wfu_cull(u3_noun cor)
{
u3_noun sut, axe, pol, ref, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &pol,
u3x_sam_6, &axe,
u3x_sam_7, &ref,
u3x_con, &van, 0)) ||
(c3n == u3ud(axe)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_cull(van, sut, pol, axe, ref);
}
}
u3_noun
u3qfu_cull(u3_noun van,
u3_noun sut,
u3_noun pol,
u3_noun axe,
u3_noun ref)
{
c3_m fun_m = c3__cull;
u3_noun pro = u3z_find_4(fun_m, sut, pol, axe, ref);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqfu_cull(van, sut, pol, axe, ref);
return u3z_save_4(fun_m, sut, pol, axe, ref, pro);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,74 +0,0 @@
/* j/6/fink.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_fink(u3_noun van,
u3_noun sut,
u3_noun dep,
u3_noun way,
u3_noun cog)
{
// u3_noun dun = u3qfu_dunq(van, "type", sut);
u3_noun nuc = (u3_blip == cog)
? u3qfu_shew(van,
u3nc(u3nc('c',
u3i_string("find-limb")),
'$'))
: u3qfu_shep(van, "find-limb", 'a', u3k(cog));
u3_noun pro;
// u3t_push(u3nc(c3__mean, dun));
u3t_push(u3nc(c3__mean, nuc));
{
u3_noun hoq = u3qfu_find(van, sut, dep, way, cog);
u3_noun fin = u3t(hoq);
if ( u3_nul == fin ) {
// u3m_p("cog", cog);
return u3m_error("find-none");
}
else {
pro = u3k(u3t(fin));
u3z(hoq);
}
}
// u3t_drop();
u3t_drop();
return pro;
}
/* boilerplate
*/
u3_noun
u3wfu_fink(u3_noun cor)
{
u3_noun sut, dep, way, cog, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &dep,
u3x_sam_6, &way,
u3x_sam_7, &cog,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_fink(van, sut, dep, way, cog);
}
}
u3_noun
u3qfu_fink(u3_noun van,
u3_noun sut,
u3_noun dep,
u3_noun way,
u3_noun cog)
{
return _cqfu_fink(van, sut, dep, way, cog);
}

View File

@ -6,6 +6,19 @@
/* logic /* logic
*/ */
static u3_noun
_fire_vet(u3_noun van)
{
// u3_noun vet = u3j_hook(u3k(van), "vet");
u3_noun vet = u3r_at(u3qfu_van_vet, van);
switch ( vet ) {
case c3n:
case c3y: return vet;
default: return u3m_bail(c3__fail);
}
}
static u3_noun static u3_noun
_fire_mull(u3_noun van, _fire_mull(u3_noun van,
u3_noun sut, u3_noun sut,
@ -18,6 +31,9 @@
u3k(gen)); u3k(gen));
u3_noun ret; u3_noun ret;
if ( c3n == _fire_vet(van) ) {
ret = c3y;
}
if ( c3y == u3qdi_has(rib, key) ) { if ( c3y == u3qdi_has(rib, key) ) {
ret = c3y; ret = c3y;
} }
@ -27,8 +43,11 @@
u3qfu_van_rib, u3qfu_van_rib,
u3k(rob), u3k(rob),
0); 0);
ret = u3qfu_mull(von, sut, c3__noun, dox, gen); u3_noun mul = u3qfu_mull(von, sut, c3__noun, dox, gen);
ret = c3y;
u3z(mul);
u3z(von); u3z(von);
u3z(rob); u3z(rob);
} }
@ -76,22 +95,24 @@
} }
else { else {
c3_assert(c3__elm == u3h(gat)); c3_assert(c3__elm == u3h(gat));
#if 0
u3_noun dun = u3qfu_dunq(van, "wild", typ);
u3_noun niz = u3qfu_dunq(van, "tame", dox);
u3t_push(u3nc(c3__mean, dun));
u3t_push(u3nc(c3__mean, niz));
#endif
if ( (c3y == vet) && if ( (c3y == vet) &&
// (c3n == u3r_sing(p_typ, qq_typ)) &&
(c3n == _fire_mull(van, typ, dox, t_gat)) ) (c3n == _fire_mull(van, typ, dox, t_gat)) )
{ {
#if 0
u3_noun dun = u3qfu_dunq(van, "wild", typ);
u3_noun niz = u3qfu_dunq(van, "tame", dox);
u3t_push(u3nc(c3__mean, dun));
u3t_push(u3nc(c3__mean, niz));
#endif
return u3m_error("fire-wet"); return u3m_error("fire-wet");
} }
else { else {
u3z(dox); u3z(dox);
#if 0
u3t_drop();
u3t_drop();
#endif
return u3nc(u3k(typ), u3k(t_gat)); return u3nc(u3k(typ), u3k(t_gat));
} }
} }
@ -126,6 +147,7 @@
{ {
u3_noun vet = u3r_at(u3qfu_van_vet, van); u3_noun vet = u3r_at(u3qfu_van_vet, van);
c3_assert(!"not live");
{ {
if ( (c3y == u3du(hag)) && (u3_nul == u3t(hag)) ) { if ( (c3y == u3du(hag)) && (u3_nul == u3t(hag)) ) {
u3_noun i_hag = u3h(hag); u3_noun i_hag = u3h(hag);

View File

@ -1,112 +0,0 @@
/* j/6/firm.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_firm(u3_noun van,
u3_noun sut,
u3_noun dib)
{
u3_noun p_sut, q_sut;
if ( c3n == u3du(sut) ) switch ( sut ) {
default: return u3m_bail(c3__fail);
case c3__noun:
{
return c3y;
}
case c3__void:
{
return c3n;
}
}
else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail);
case c3__atom: p_sut = u3t(sut);
{
return u3ud(dib);
}
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun nun = u3r_at(u3h(u3t(u3t(p_sut))), dib);
if ( u3_none == nun ) {
return c3n;
} else {
return c3a(_cqfu_firm(van, q_sut, dib),
_cqfu_firm(van, u3t(u3t(u3t(p_sut))),
nun));
}
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return c3a(u3du(dib),
c3a(_cqfu_firm(van, p_sut, u3h(dib)),
_cqfu_firm(van, q_sut, u3t(dib))));
}
case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun pq_sut, qq_sut, rq_sut, prq_sut, qrq_sut;
u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut);
u3x_cell(rq_sut, &prq_sut, &qrq_sut);
return c3a(u3du(dib),
c3a(_cqfu_firm(van, p_sut, u3h(dib)),
((u3_nul == prq_sut) ? u3m_error("firm-core")
: u3r_sing(prq_sut,
u3t(dib)))));
}
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3r_sing(dib, p_sut);
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return _cqfu_firm(van, q_sut, dib);
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return c3o(_cqfu_firm(van, p_sut, dib),
_cqfu_firm(van, q_sut, dib));
}
case c3__hold:
{
u3_noun goy = u3qfu_repo(van, sut);
u3_noun ret = _cqfu_firm(van, goy, dib);
u3z(goy);
return ret;
}
}
}
/* boilerplate
*/
u3_noun
u3wfu_firm(u3_noun cor)
{
u3_noun sut, dib, van;
if ( (c3n == u3r_mean(cor, u3x_sam, &dib, u3x_con, &van, 0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_firm(van, sut, dib);
}
}
u3_noun
u3qfu_firm(u3_noun van,
u3_noun sut,
u3_noun dib)
{
return _cqfu_firm(van, sut, dib);
}

View File

@ -3,9 +3,32 @@
*/ */
#include "all.h" #include "all.h"
/* functions /* functions
*/ */
static u3_noun
_fish_in(u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_fish_fork(u3_noun van,
u3_noun p_sut,
u3_atom axe,
u3_noun vit)
{
if ( u3_nul == p_sut ) {
return u3nc(1, 1);
}
else {
u3_noun hed = _fish_in(van, u3h(p_sut), axe, vit);
u3_noun tal = _fish_fork(van, u3t(p_sut), axe, vit);
u3_noun pro = u3qf_flor(hed, tal);
u3z(hed);
u3z(tal);
return pro;
}
}
static u3_noun static u3_noun
_fish_in(u3_noun van, _fish_in(u3_noun van,
u3_noun sut, u3_noun sut,
@ -28,14 +51,21 @@
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__atom: { case c3__atom: {
u3_noun ton = u3nt(3, 0, u3k(axe)); if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
u3_noun pro = u3qf_flip(ton); return u3m_bail(c3__fail);
} else {
if ( c3n == u3du(q_sut) ) {
u3_noun ton = u3nt(3, 0, u3k(axe));
u3_noun pro = u3qf_flip(ton);
u3z(ton); u3z(ton);
return pro; return pro;
} } else {
case c3__bull: { return u3nt(5,
return u3m_error("bull-fish"); u3nc(1, u3k(u3t(q_sut))),
u3nc(0, u3k(axe)));
}
}
} }
case c3__cell: { case c3__cell: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
@ -62,15 +92,6 @@
case c3__core: { case c3__core: {
return u3nc(0, 0); return u3nc(0, 0);
} }
case c3__cube: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return u3nt(5,
u3nc(1, u3k(p_sut)),
u3nc(0, u3k(axe)));
}
}
case c3__face: { case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
@ -78,20 +99,13 @@
return _fish_in(van, q_sut, axe, vit); return _fish_in(van, q_sut, axe, vit);
} }
} }
case c3__fork: { case c3__fork: p_sut = u3t(sut);
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { {
return u3m_bail(c3__fail); u3_noun yed = u3qdi_tap(p_sut, u3_nul);
} u3_noun ret = _fish_fork(van, yed, axe, vit);
else {
u3_noun hed = _fish_in(van, p_sut, axe, vit);
u3_noun tal = _fish_in(van, q_sut, axe, vit);
u3_noun pro = u3qf_flor(hed, tal);
u3z(hed); u3z(yed);
u3z(tal); return ret;
return pro;
}
} }
case c3__hold: { case c3__hold: {
p_sut = u3t(sut); p_sut = u3t(sut);
@ -107,7 +121,7 @@
return u3m_error("fish-loop"); return u3m_error("fish-loop");
} else { } else {
u3_noun zoc = u3qdi_put(vit, sut); u3_noun zoc = u3qdi_put(vit, sut);
u3_noun fop = u3qfu_rest(van, sut, p_sut); u3_noun fop = u3qfu_repo(van, sut);
u3_noun pro = _fish_in(van, fop, axe, zoc); u3_noun pro = _fish_in(van, fop, axe, zoc);
u3z(fop); u3z(fop);
@ -150,7 +164,7 @@
u3_noun sut, u3_noun sut,
u3_noun axe) u3_noun axe)
{ {
c3_m fun_m = c3__fish; c3_m fun_m = c3__fish + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find_2(fun_m, sut, axe); u3_noun pro = u3z_find_2(fun_m, sut, axe);
if ( u3_none != pro ) { if ( u3_none != pro ) {

View File

@ -3,7 +3,6 @@
*/ */
#include "all.h" #include "all.h"
/* logic /* logic
*/ */
static u3_noun static u3_noun
@ -32,6 +31,18 @@
} }
} }
static u3_noun
_fuse_in_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_fuse_in(van, u3h(p_sut), ref, bix),
_fuse_in_fork(van, u3t(p_sut), ref, bix));
}
}
static u3_noun static u3_noun
_fuse_in(u3_noun van, _fuse_in(u3_noun van,
u3_noun sut, u3_noun sut,
@ -58,13 +69,35 @@
else switch ( u3h(sut) ) { else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__atom: case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
if ( c3y == u3du(ref) ) { if ( c3y == u3du(ref) ) {
if ( c3__atom == u3h(ref) ) { if ( c3__atom == u3h(ref) ) {
if ( c3y == u3qf_fitz(u3t(ref), u3t(sut)) ) { u3_noun p_ref, q_ref;
return u3k(sut);
} else return u3k(ref); u3x_cell(u3t(ref), &p_ref, &q_ref);
{
u3_noun foc = (c3y == u3qf_fitz(p_ref, p_sut))
? u3k(p_sut)
: u3k(p_ref);
if ( c3y == u3du(q_sut) ) {
if ( c3y == u3du(q_ref) ) {
if ( c3y == u3r_sing(q_ref, q_sut) ) {
return u3nt(c3__atom, foc, u3k(q_sut));
}
else {
u3z(foc);
return c3__void;
}
}
else {
return u3nt(c3__atom, foc, u3k(q_sut));
}
} else {
return u3nt(c3__atom, foc, u3k(q_ref));
}
}
} }
else if ( c3__cell == u3h(ref) ) { else if ( c3__cell == u3h(ref) ) {
return c3__void; return c3__void;
@ -72,14 +105,6 @@
} }
return _fuse_in(van, ref, sut, bix); return _fuse_in(van, ref, sut, bix);
} }
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun vot = _fuse_in(van, q_sut, ref, bix);
u3_noun ret = u3qf_bull(p_sut, vot);
u3z(vot);
return ret;
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
u3_noun p_ref, q_ref; u3_noun p_ref, q_ref;
@ -99,19 +124,6 @@
{ {
return _fuse_repo(van, sut, ref, bix); return _fuse_repo(van, sut, ref, bix);
} }
case c3__cube: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun foz = _fuse_in(van, q_sut, ref, bix);
u3_noun ret;
if ( c3n == u3qfu_firm(van, foz, p_sut) ) {
ret = c3__void;
} else {
ret = u3qf_cube(p_sut, foz);
}
u3z(foz);
return ret;
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{ {
u3_noun vot = _fuse_in(van, q_sut, ref, bix); u3_noun vot = _fuse_in(van, q_sut, ref, bix);
@ -120,17 +132,15 @@
u3z(vot); u3z(vot);
return ret; return ret;
} }
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__fork: p_sut = u3t(sut);
{ {
u3_noun dis = _fuse_in(van, p_sut, ref, bix); u3_noun yed = u3qdi_tap(p_sut, u3_nul);
u3_noun dat = _fuse_in(van, q_sut, ref, bix); u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix));
u3_noun ret = u3qf_fork(dis, dat);
u3z(dis); u3z(yed);
u3z(dat);
return ret; return ret;
} }
case c3__hold: p_sut = u3t(sut); case c3__hold:
{ {
u3_noun hud = u3nc(u3k(sut), u3k(ref)); u3_noun hud = u3nc(u3k(sut), u3k(ref));
@ -183,7 +193,7 @@
u3_noun sut, u3_noun sut,
u3_noun ref) u3_noun ref)
{ {
c3_m fun_m = c3__fuse; c3_m fun_m = c3__fuse + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find_2(fun_m, sut, ref); u3_noun pro = u3z_find_2(fun_m, sut, ref);
if ( u3_none != pro ) { if ( u3_none != pro ) {

View File

@ -1,241 +0,0 @@
/* j/6/heal.c
**
*/
#include "all.h"
/* internals
*/
static u3_noun
_heal_as(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_heal_by(u3_noun van,
u3_noun sut,
u3_noun qog,
u3_noun ref)
{
u3_noun p_sut, q_sut;
if ( c3n == u3du(sut) ) {
return u3m_error("heal-name");
}
else switch ( u3h(sut) ) {
default: return u3m_error("heal-name");
case c3__core:
{
return u3k(ref);
}
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( c3y == u3r_sing(u3h(p_sut), u3t(qog)) ) {
return u3k(ref);
}
else {
u3_noun sub = _heal_by(van, q_sut, qog, ref);
u3_noun ret;
ret = u3qfu_busk(van,
sub,
u3h(p_sut),
u3h(u3t(p_sut)));
u3z(sub);
return ret;
}
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( c3y == u3r_sing(p_sut, u3t(qog)) ) {
return u3qf_face(p_sut, ref);
}
else return u3m_error("heal-name");
}
case c3__hold: {
u3_noun rep = u3qfu_repo(van, sut);
u3_noun ret = _heal_by(van, rep, qog, ref);
u3z(rep);
return ret;
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun dis = _heal_by(van, p_sut, qog, ref);
u3_noun dat = _heal_by(van, q_sut, qog, ref);
u3_noun ret = u3qf_fork(dis, dat);
u3z(dis);
u3z(dat);
return ret;
}
}
}
static u3_noun
_heal_to(u3_noun van,
u3_noun sut,
u3_noun gil,
u3_noun qog,
u3_noun ref,
u3_atom now,
u3_atom lat)
{
u3_noun p_sut, q_sut;
if ( c3n == u3du(sut) ) {
goto repo;
}
else switch ( u3h(sut) ) {
default: goto repo;
case c3__atom: return c3__void;
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun sub = _heal_to(van, q_sut, gil, qog, ref, now, lat);
u3_noun ret;
ret = u3qfu_busk
(van, sub, u3h(p_sut), u3h(u3t(p_sut)));
u3z(sub);
return ret;
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun ter, ret;
if ( 2 == now ) {
ter = _heal_as(van, p_sut, qog, lat, ref);
ret = u3qf_cell(ter, q_sut);
} else {
ter = _heal_as(van, q_sut, qog, lat, ref);
ret = u3qf_cell(p_sut, ter);
}
u3z(ter);
return ret;
}
case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( 3 != now ) {
return u3m_error("heal-core");
} else {
u3_noun ter = _heal_as(van, p_sut, qog, lat, ref);
u3_noun ret = u3qf_core(ter, q_sut);
u3z(ter);
return ret;
}
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun dun = _heal_to(van, q_sut, gil, qog, ref, now, lat);
u3_noun ret = u3qf_face(p_sut, dun);
u3z(dun);
return ret;
}
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun dis = _heal_to(van, p_sut, gil, qog, ref, now, lat);
u3_noun dat = _heal_to(van, q_sut, gil, qog, ref, now, lat);
u3_noun ret = u3qf_fork(dis, dat);
u3z(dis);
u3z(dat);
return ret;
}
case c3__hold: {
if ( (c3y == u3qdi_has(gil, sut)) ) {
return c3__void;
}
else {
u3_noun zoc = u3qdi_put(gil, sut);
u3_noun rep = u3qfu_repo(van, sut);
u3_noun ret = _heal_to(van, rep, zoc, qog, ref, now, lat);
u3z(rep);
u3z(zoc);
return ret;
}
}
}
repo: {
u3_noun rep = u3qfu_repo(van, sut);
u3_noun ret = _heal_to(van, rep, gil, qog, ref, now, lat);
u3z(rep);
return ret;
}
}
static u3_noun
_heal_as(u3_noun van,
u3_noun sut,
u3_noun qog,
u3_atom axe,
u3_noun ref)
{
if ( 1 == axe ) {
if ( u3_nul == qog ) {
return u3k(ref);
} else return _heal_by(van, sut, qog, ref);
}
else {
u3_atom now = u3qc_cap(axe);
u3_atom lat = u3qc_mas(axe);
u3_noun ret = _heal_to(van, sut, u3_nul, qog, ref, now, lat);
u3z(lat);
return ret;
}
}
/* functions
*/
u3_noun
_cqfu_heal(u3_noun van,
u3_noun sut,
u3_noun qog,
u3_noun axe,
u3_noun ref)
{
return _heal_as(van, sut, qog, axe, ref);
}
/* boilerplate
*/
u3_noun
u3wfu_heal(u3_noun cor)
{
u3_noun van, sut, qog, axe, ref;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &qog,
u3x_sam_6, &axe,
u3x_sam_7, &ref,
u3x_con, &van,
0)) ||
(c3n == u3ud(axe)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_heal(van, sut, qog, axe, ref);
}
}
u3_noun
u3qfu_heal(u3_noun van,
u3_noun sut,
u3_noun qog,
u3_noun axe,
u3_noun ref)
{
return _cqfu_heal(van, sut, qog, axe, ref);
}

View File

@ -3,20 +3,17 @@
*/ */
#include "all.h" #include "all.h"
int FOO;
/* logic /* logic
*/ */
static u3_noun static u3_noun
_mint_in(u3_noun, u3_noun, u3_noun, u3_noun); _mint_in(u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun static u3_noun
_mint_bean(void) _mint_bean()
{ {
return u3nt(c3__fork, return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__cube, 0, c3__atom, 'f'), u3nq(c3__atom, 'f', u3_nul, 1),
u3nq(c3__cube, 1, c3__atom, 'f')); u3_nul));
} }
static u3_noun static u3_noun
@ -43,34 +40,6 @@ int FOO;
} }
} }
static u3_noun
_mint_foil(u3_noun pok)
{
u3_noun p_pok = u3h(pok);
u3_noun q_pok = u3t(pok);
u3_noun ret;
if ( c3y == u3h(q_pok) ) {
u3_noun pq_pok = u3t(q_pok);
ret = u3nc(u3k(p_pok),
u3nc(u3_nul,
u3nc(u3nc(u3k(pq_pok),
u3nt(c3__elm, u3_nul, 1)),
u3_nul)));
}
else {
u3_noun pq_pok = u3h(u3t(q_pok));
u3_noun qq_pok = u3t(u3t(q_pok));
ret = u3nc(u3k(p_pok),
u3nc(u3k(pq_pok),
u3k(qq_pok)));
}
u3z(pok);
return ret;
}
static u3_noun static u3_noun
_mint_cond(u3_noun pex, _mint_cond(u3_noun pex,
u3_noun yom, u3_noun yom,
@ -143,48 +112,6 @@ int FOO;
return axe; return axe;
} }
static u3_noun
_mint_edit(u3_noun van,
u3_noun sut,
u3_noun mew,
u3_noun p_lar,
u3_noun rag,
u3_noun hej)
{
while ( 1 ) {
if ( c3n == u3du(mew) ) {
u3_noun gim = u3qfu_fire(van, sut, rag);
u3_noun fol = u3qf_hike(p_lar, hej);
u3z(rag);
u3z(hej);
return u3nc(gim, fol);
} else {
u3_noun i_mew = u3h(mew);
u3_noun t_mew = u3t(mew);
u3_noun pi_mew = u3h(i_mew);
u3_noun qi_mew = u3t(i_mew);
u3_noun zil = u3qfu_mint(van, sut, c3__noun, qi_mew);
u3_noun p_zil = u3h(zil);
u3_noun q_zil = u3t(zil);
u3_noun wip = u3qfu_tock(van, sut, pi_mew, p_zil, rag);
u3z(rag);
rag = u3k(u3t(wip));
hej = u3nc(u3nc(u3k(u3h(wip)),
u3k(q_zil)),
hej);
u3z(zil);
u3z(wip);
mew = t_mew;
}
}
}
static u3_noun static u3_noun
_mint_brew(u3_noun van, _mint_brew(u3_noun van,
u3_noun sut, u3_noun sut,
@ -306,6 +233,95 @@ int FOO;
return ret; return ret;
} }
#if 1
static u3_noun
_mint_cnts(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun hyp,
u3_noun rig)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "emin");
return u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(gol),
u3x_sam_6,
u3k(hyp),
u3x_sam_7,
u3k(rig),
0));
}
#else
static u3_noun
_mint_edit(u3_noun van,
u3_noun sut,
u3_noun mew,
u3_noun p_lar,
u3_noun rag,
u3_noun hej)
{
while ( 1 ) {
if ( c3n == u3du(mew) ) {
u3_noun gim = u3qfu_fire(van, sut, rag);
u3_noun fol = u3qf_hike(p_lar, hej);
u3z(rag);
u3z(hej);
return u3nc(gim, fol);
} else {
u3_noun i_mew = u3h(mew);
u3_noun t_mew = u3t(mew);
u3_noun pi_mew = u3h(i_mew);
u3_noun qi_mew = u3t(i_mew);
u3_noun zil = u3qfu_mint(van, sut, c3__noun, qi_mew);
u3_noun p_zil = u3h(zil);
u3_noun q_zil = u3t(zil);
u3_noun wip = u3qfu_toss(van, sut, pi_mew, p_zil, rag);
u3z(rag);
rag = u3k(u3t(wip));
hej = u3nc(u3nc(u3k(u3h(wip)),
u3k(q_zil)),
hej);
u3z(zil);
u3z(wip);
mew = t_mew;
}
}
}
static u3_noun
_mint_cnts_old(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun hyp,
u3_noun rig)
{
u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp);
u3_noun p_lar = u3h(lar);
u3_noun q_lar = u3t(lar);
u3_noun pq_lar = u3h(q_lar);
u3_noun qq_lar = u3t(q_lar);
u3_noun mew = rig;
u3_noun yom = _mint_edit(van, sut, mew, p_lar, u3k(qq_lar), u3_nul);
u3_noun p_yom = u3h(yom);
u3_noun q_yom = u3t(yom);
u3_noun ret = u3nc(_mint_nice(van, gol, u3k(p_yom)),
(0 == pq_lar) ? u3k(q_yom)
: u3nt(9, u3k(pq_lar), u3k(q_yom)));
u3z(yom);
u3z(lar);
return ret;
}
#endif
# define _mint_used() # define _mint_used()
static u3_noun static u3_noun
@ -318,11 +334,14 @@ int FOO;
u3_noun ret; u3_noun ret;
if ( (c3__void == sut) && if ( (c3__void == sut) &&
!((c3y == u3du(gen)) && (c3__zpcb == u3h(gen))) ) !((c3y == u3du(gen)) && (c3__dbug == u3h(gen))) )
{ {
if ( (c3n == _mint_vet(van)) if ( (c3n == _mint_vet(van))
|| ((c3y == u3du(gen)) && || ((c3y == u3du(gen)) &&
((c3__zpfs == u3h(gen)) || (c3__zpzp == u3h(gen)))) ) ((c3__zpfs == u3h(gen)) ||
(c3__lost == u3h(gen)) ||
(c3__fail == u3h(gen)) ||
(c3__zpzp == u3h(gen)))) )
{ {
return u3nt(c3__void, 0, 0); return u3nt(c3__void, 0, 0);
} }
@ -378,25 +397,12 @@ int FOO;
return ret; return ret;
} }
case c3__bcpt: u3x_cell(u3t(gen), &p_gen, &q_gen); case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun sep = u3qfu_seep(van, sut, c3__read, p_gen); u3_noun heb = u3nc(c3__herb, u3k(p_gen));
u3_noun axe = u3h(sep); u3_noun nob = u3qfl_bunt(van, heb);
u3_noun rex = u3qfl_whip(van, q_gen, axe); u3_noun dok = u3nc(c3__wing, u3k(q_gen));
u3_noun ret = _mint_in(van, sut, gol, rex);
u3z(sep);
u3z(rex);
return ret;
}
case c3__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun nob = u3qfl_bunt(van, p_gen);
u3_noun dok = u3nc(c3__cnzz, u3k(q_gen));
u3_noun vol = _mint_corn(van, sut, dok); u3_noun vol = _mint_corn(van, sut, dok);
u3_noun axe = _mint_coke(vol); u3_noun axe = _mint_coke(vol);
u3_noun wam = u3qfu_play(van, sut, nob); u3_noun wam = u3qfu_play(van, sut, nob);
@ -408,11 +414,12 @@ int FOO;
u3z(wam); u3z(wam);
u3z(nob); u3z(nob);
u3z(dok); u3z(dok);
u3z(heb);
return ret; return ret;
} }
case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); case c3__if: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mint_used(); _mint_used();
{ {
u3_noun bol = _mint_bean(); u3_noun bol = _mint_bean();
@ -429,7 +436,7 @@ int FOO;
u3_noun hiq = _mint_in(van, fex, gol, q_gen); u3_noun hiq = _mint_in(van, fex, gol, q_gen);
u3_noun ran = _mint_in(van, wux, gol, r_gen); u3_noun ran = _mint_in(van, wux, gol, r_gen);
ret = u3nc(u3qf_fork(u3h(hiq), ret = u3nc(u3qf_forq(u3h(hiq),
u3h(ran)), u3h(ran)),
_mint_cond(duy, _mint_cond(duy,
u3k(u3t(hiq)), u3k(u3t(hiq)),
@ -444,7 +451,8 @@ int FOO;
return ret; return ret;
} }
case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__cons: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun hed = _mint_in(van, sut, c3__noun, p_gen); u3_noun hed = _mint_in(van, sut, c3__noun, p_gen);
@ -460,16 +468,29 @@ int FOO;
return ret; return ret;
} }
case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__same: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun typ = _mint_nice(van, gol, _mint_bean()); u3_noun typ = _mint_nice(van, gol, _mint_bean());
u3_noun one = _mint_corn(van, sut, p_gen); u3_noun one = _mint_in(van, sut, c3__noun, p_gen);
u3_noun two = _mint_corn(van, sut, q_gen); u3_noun two = _mint_in(van, sut, c3__noun, q_gen);
u3_noun ret;
return u3nc(typ, u3nt(5, one, two)); if ( (c3y == _mint_vet(van)) &&
(c3n == u3qfu_nest(van, u3h(one), c3n, u3h(two))) &&
(c3n == u3qfu_nest(van, u3h(two), c3y, u3h(one))) )
{
return u3m_error("nest");
}
ret = u3nc(typ, u3nt(5, u3k(u3t(one)), u3k(u3t(two))));
u3z(one);
u3z(two);
return ret;
} }
case c3__dtwt: p_gen = u3t(gen);
case c3__deep: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun typ = _mint_nice(van, gol, _mint_bean()); u3_noun typ = _mint_nice(van, gol, _mint_bean());
@ -477,22 +498,27 @@ int FOO;
return u3nc(typ, return u3nc(typ,
u3nc(3, _mint_corn(van, sut, p_gen))); u3nc(3, _mint_corn(van, sut, p_gen)));
} }
case c3__dtkt: p_gen = u3t(gen);
case c3__wish: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun tom = c3__noun; u3_noun nog = u3nc(c3__bunt, u3k(p_gen));
u3_noun sam = _mint_in(van, sut, tom, p_gen); u3_noun nef = _mint_in(van, sut, gol, nog);
u3_noun viz = _mint_in(van, sut, c3__noun, q_gen);
ret = u3nc(u3k(u3h(nef)),
u3nt(11, u3nc(1, u3nc(151, u3k(u3h(nef)))), u3k(u3t(viz))));
ret = u3nc(_mint_nice(van, gol, tom), u3z(viz);
u3nc(11, u3k(u3t(sam)))); u3z(nef);
u3z(nog);
u3z(sam);
return ret; return ret;
} }
case c3__dtls: p_gen = u3t(gen);
case c3__bump: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun tom = u3nc(c3__atom, u3_blip); u3_noun tom = u3nt(c3__atom, u3_blip, u3_nul);
u3_noun sam = _mint_in(van, sut, tom, p_gen); u3_noun sam = _mint_in(van, sut, tom, p_gen);
ret = u3nc(_mint_nice(van, gol, tom), ret = u3nc(_mint_nice(van, gol, tom),
@ -501,29 +527,8 @@ int FOO;
u3z(sam); u3z(sam);
return ret; return ret;
} }
case c3__dtzz: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun boc = (c3n == u3ud(q_gen))
? c3__noun
: u3nc(c3__atom, u3k(p_gen));
u3_noun typ = u3qf_cube(q_gen, boc);
u3_noun ret = u3nc(_mint_nice(van, gol, typ),
u3nc(1, u3k(q_gen)));
u3z(boc); case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen);
return ret;
}
case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun one = _mint_corn(van, sut, p_gen);
u3_noun two = _mint_corn(van, sut, q_gen);
return u3nc(_mint_nice(van, gol, c3__noun),
u3nt(2, one, two));
}
case c3__dtzy: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun typ = u3qfu_play(van, sut, gen); u3_noun typ = u3qfu_play(van, sut, gen);
@ -532,7 +537,34 @@ int FOO;
return ret; return ret;
} }
case c3__ktbr: p_gen = u3t(gen);
case c3__nock: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun one = _mint_corn(van, sut, p_gen);
u3_noun two = _mint_corn(van, sut, q_gen);
return u3nc(_mint_nice(van, gol, c3__noun),
u3nt(2, one, two));
}
case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun typ = u3qfu_play(van, sut, gen);
u3_noun ret = u3nc(_mint_nice(van, gol, typ),
u3nc(1, u3k(q_gen)));
return ret;
}
case c3__hand:
_mint_used();
{
return u3k(u3t(gen));
}
case c3__iron: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun ryd = _mint_in(van, sut, gol, p_gen); u3_noun ryd = _mint_in(van, sut, gol, p_gen);
@ -542,7 +574,8 @@ int FOO;
u3z(ryd); u3z(ryd);
return pro; return pro;
} }
case c3__ktpm: p_gen = u3t(gen);
case c3__zinc: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun ryd = _mint_in(van, sut, gol, p_gen); u3_noun ryd = _mint_in(van, sut, gol, p_gen);
@ -552,7 +585,8 @@ int FOO;
u3z(ryd); u3z(ryd);
return pro; return pro;
} }
case c3__ktwt: p_gen = u3t(gen);
case c3__lead: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun ryd = _mint_in(van, sut, gol, p_gen); u3_noun ryd = _mint_in(van, sut, gol, p_gen);
@ -562,7 +596,8 @@ int FOO;
u3z(ryd); u3z(ryd);
return pro; return pro;
} }
case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__name: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun vat = _mint_in(van, sut, gol, q_gen); u3_noun vat = _mint_in(van, sut, gol, q_gen);
@ -573,18 +608,8 @@ int FOO;
u3z(vat); u3z(vat);
return ret; return ret;
} }
case c3__ktzp: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun vat = _mint_in(van, sut, gol, q_gen);
ret = u3nc(u3qfu_conk(van, u3h(vat), p_gen), case c3__burn: p_gen = u3t(gen);
u3k(u3t(vat)));
u3z(vat);
return ret;
}
case c3__ktsg: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun nef = _mint_in(van, sut, gol, p_gen); u3_noun nef = _mint_in(van, sut, gol, p_gen);
@ -608,7 +633,8 @@ int FOO;
u3z(nef); u3z(nef);
return ret; return ret;
} }
case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__like: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun huz = u3qfu_play(van, sut, p_gen); u3_noun huz = u3qfu_play(van, sut, p_gen);
@ -619,30 +645,8 @@ int FOO;
u3z(zel); u3z(zel);
return ret; return ret;
} }
case c3__kthx: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun huz = u3qfu_play(van, sut, p_gen);
u3_noun hif = _mint_nice(van, gol, huz);
u3_noun zel = _mint_in(van, sut, hif, q_gen);
u3_noun ret = u3nc(hif, u3k(u3t(zel)));
#if 0 case c3__per: u3x_cell(u3t(gen), &p_gen, &q_gen);
{
u3_noun goz = u3qfu_play(van, sut, q_gen);
u3_noun bar;
FOO = 1;
fprintf(stderr, "\r\n");
bar = u3qfu_nest(van, huz, c3n, goz);
fprintf(stderr, "kthx: bar %d\r\n", bar);
FOO = 0;
}
#endif
u3z(zel);
return ret;
}
case c3__tsgr: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun fid = _mint_in(van, sut, c3__noun, p_gen); u3_noun fid = _mint_in(van, sut, c3__noun, p_gen);
@ -659,54 +663,24 @@ int FOO;
u3z(dov); u3z(dov);
return ret; return ret;
} }
case c3__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
case c3__aka: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mint_used(); _mint_used();
{ {
u3_noun sep = u3qfu_seep(van, sut, c3__both, q_gen); u3_noun boc = u3qfu_buss(van, sut, p_gen, q_gen);
u3_noun bid = u3nt(u3k(p_gen), u3k(q_gen), sep);
u3_noun boc = u3qf_bull(bid, sut);
u3_noun ret = _mint_in(van, boc, gol, r_gen); u3_noun ret = _mint_in(van, boc, gol, r_gen);
u3z(bid);
u3z(boc); u3z(boc);
return ret; return ret;
} }
case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__make: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun sec = u3qfu_seek(van, sut, c3__read, p_gen); return _mint_cnts(van, sut, gol, p_gen, q_gen);
u3_noun lar = _mint_foil(sec);
u3_noun p_lar = u3h(lar);
u3_noun q_lar = u3t(lar);
u3_noun pq_lar = u3h(q_lar);
u3_noun qq_lar = u3t(q_lar);
u3_noun mew = u3qfu_snub(van, sut, q_gen);
u3_noun yom = _mint_edit(van, sut, mew, p_lar, u3k(qq_lar), u3_nul);
u3_noun p_yom = u3h(yom);
u3_noun q_yom = u3t(yom);
u3_noun ret = u3nc(_mint_nice(van, gol, u3k(p_yom)),
(0 == pq_lar) ? u3k(q_yom)
: u3nt(9, u3k(pq_lar), u3k(q_yom)));
u3z(yom);
u3z(mew);
u3z(lar);
return ret;
} }
case c3__pmcl: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun ruf = u3nt(c3__clhp,
u3nc(u3_nul, 1),
u3k(p_gen));
u3_noun ret = _mint_grow(van, sut, gol, c3__zinc, ruf, q_gen);
u3z(ruf); case c3__core: p_gen = u3t(gen);
return ret;
}
case c3__brcn: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun ruf = u3nc(u3_nul, 1); u3_noun ruf = u3nc(u3_nul, 1);
@ -716,28 +690,8 @@ int FOO;
return ret; return ret;
} }
case c3__pmcn: p_gen = u3t(gen);
_mint_used();
{
u3_noun ruf = u3nc(u3_nul, 1);
ret = _mint_grow(van, sut, gol, c3__lead, ruf, p_gen); case c3__peep: u3x_cell(u3t(gen), &p_gen, &q_gen);
u3z(ruf);
return ret;
}
case c3__pmls: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun ruf = u3nt(c3__clhp,
u3nc(u3_nul, 1),
u3k(p_gen));
u3_noun ret = _mint_grow(van, sut, gol, c3__iron, ruf, q_gen);
u3z(ruf);
return ret;
}
case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun typ = u3qfu_play(van, sut, p_gen); u3_noun typ = u3qfu_play(van, sut, p_gen);
@ -752,7 +706,8 @@ int FOO;
u3z(typ); u3z(typ);
return ret; return ret;
} }
case c3__sggr: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__hint: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun hum = _mint_in(van, sut, gol, q_gen); u3_noun hum = _mint_in(van, sut, gol, q_gen);
@ -761,12 +716,6 @@ int FOO;
if ( c3y == u3ud(p_gen) ) { if ( c3y == u3ud(p_gen) ) {
bez = u3k(p_gen); bez = u3k(p_gen);
} else { } else {
#ifdef HUSH
bez = u3h(p_gen);
if(!(bez == c3__fast || bez == c3__memo)){
return hum;
}
#endif
bez = u3nc(u3k(u3h(p_gen)), bez = u3nc(u3k(u3h(p_gen)),
_mint_corn(van, sut, u3t(p_gen))); _mint_corn(van, sut, u3t(p_gen)));
} }
@ -776,7 +725,8 @@ int FOO;
u3z(hum); u3z(hum);
return ret; return ret;
} }
case c3__zpts: p_gen = u3t(gen);
case c3__code: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0);
@ -785,7 +735,8 @@ int FOO;
u3z(von); u3z(von);
return u3nc(c3__noun, u3nc(1, sev)); return u3nc(c3__noun, u3nc(1, sev));
} }
case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__twig: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
return u3nc(_mint_nice(van, return u3nc(_mint_nice(van,
@ -793,7 +744,8 @@ int FOO;
u3qfu_play(van, sut, p_gen)), u3qfu_play(van, sut, p_gen)),
u3nc(1, u3k(q_gen))); u3nc(1, u3k(q_gen)));
} }
case c3__zpcb: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen);
{ {
u3t_push(u3nc(c3__mean, _mint_loc(van, p_gen))); u3t_push(u3nc(c3__mean, _mint_loc(van, p_gen)));
{ {
@ -806,21 +758,8 @@ int FOO;
u3t_drop(); u3t_drop();
return ret; return ret;
} }
case c3__zpcn:
_mint_used();
{
u3_noun pet = u3j_hook(u3k(van), "seed");
u3_noun p_pet = u3h(pet);
u3_noun q_pet = u3t(pet);
u3_noun ret;
ret = u3nc(_mint_nice(van, gol, u3k(p_pet)), case c3__spit: u3x_cell(u3t(gen), &p_gen, &q_gen);
u3nc(1, u3k(q_pet)));
u3z(pet);
return ret;
}
case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used(); _mint_used();
{ {
u3_noun vos = _mint_in(van, sut, c3__noun, q_gen); u3_noun vos = _mint_in(van, sut, c3__noun, q_gen);
@ -842,7 +781,8 @@ int FOO;
return ret; return ret;
} }
case c3__zpfs: p_gen = u3t(gen);
case c3__lost: p_gen = u3t(gen);
_mint_used(); _mint_used();
{ {
if ( c3y == _mint_vet(van) ) { if ( c3y == _mint_vet(van) ) {
@ -856,7 +796,8 @@ int FOO;
return u3nt(c3__void, 0, 0); return u3nt(c3__void, 0, 0);
} }
} }
case c3__zpzp:
case c3__fail:
_mint_used(); _mint_used();
{ {
return u3nt(c3__void, 0, 0); return u3nt(c3__void, 0, 0);

View File

@ -3,25 +3,11 @@
*/ */
#include "all.h" #include "all.h"
/* functions /* functions
*/ */
static u3_noun static u3_noun
_mull_in(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); _mull_in(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_mull_vet(u3_noun van)
{
// u3_noun vet = u3j_hook(u3k(van), "vet");
u3_noun vet = u3r_at(u3qfu_van_vet, van);
switch ( vet ) {
case c3n:
case c3y: return vet;
default: return u3m_bail(c3__fail);
}
}
static u3_noun static u3_noun
_mull_core(u3_noun pac, _mull_core(u3_noun pac,
u3_noun con) u3_noun con)
@ -36,9 +22,9 @@
static u3_noun static u3_noun
_mull_bean() _mull_bean()
{ {
return u3nt(c3__fork, return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__cube, 0, c3__atom, 'f'), u3nq(c3__atom, 'f', u3_nul, 1),
u3nq(c3__cube, 1, c3__atom, 'f')); u3_nul));
} }
static u3_noun static u3_noun
@ -55,34 +41,6 @@
return ret; return ret;
} }
static u3_noun
_mull_foil(u3_noun pok)
{
u3_noun p_pok = u3h(pok);
u3_noun q_pok = u3t(pok);
u3_noun ret;
if ( c3y == u3h(q_pok) ) {
u3_noun pq_pok = u3t(q_pok);
ret = u3nc(u3k(p_pok),
u3nc(u3_nul,
u3nc(u3nc(u3k(pq_pok),
u3nt(c3__elm, u3_nul, 1)),
u3_nul)));
}
else {
u3_noun pq_pok = u3h(u3t(q_pok));
u3_noun qq_pok = u3t(u3t(q_pok));
ret = u3nc(u3k(p_pok),
u3nc(u3k(pq_pok),
u3k(qq_pok)));
}
u3z(pok);
return ret;
}
static u3_noun static u3_noun
_mull_coke(u3_noun nug) _mull_coke(u3_noun nug)
{ {
@ -228,6 +186,30 @@
typ); typ);
} }
#if 1
static u3_noun
_mull_cnts(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun dox,
u3_noun hyp,
u3_noun rig)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "emul");
return u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(gol),
u3x_sam_6,
u3k(dox),
u3x_sam_14,
u3k(hyp),
u3x_sam_15,
u3k(rig),
0));
}
#else
static u3_noun static u3_noun
_mull_edit(u3_noun van, _mull_edit(u3_noun van,
u3_noun sut, u3_noun sut,
@ -247,8 +229,8 @@
u3_noun zil = _mull_in(van, sut, c3__noun, dox, qi_mew); u3_noun zil = _mull_in(van, sut, c3__noun, dox, qi_mew);
u3_noun p_zil = u3h(zil); u3_noun p_zil = u3h(zil);
u3_noun q_zil = u3t(zil); u3_noun q_zil = u3t(zil);
u3_noun cuf = u3qfu_tock(van, sut, pi_mew, p_zil, p_yom); u3_noun cuf = u3qfu_toss(van, sut, pi_mew, p_zil, p_yom);
u3_noun dof = u3qfu_tock(van, sut, pi_mew, q_zil, q_yom); u3_noun dof = u3qfu_toss(van, sut, pi_mew, q_zil, q_yom);
if ( u3r_sing(u3h(cuf), u3h(dof)) ) { if ( u3r_sing(u3h(cuf), u3h(dof)) ) {
u3m_error("mull-bonk-a"); u3m_error("mull-bonk-a");
@ -269,6 +251,47 @@
} }
} }
static u3_noun
_mull_cnts_old(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun dox,
u3_noun hyp,
u3_noun rig)
{
u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp);
u3_noun vug = u3qfu_seek(van, dox, c3__read, hyp);
u3_noun p_lar = u3h(lar);
u3_noun q_lar = u3t(lar);
u3_noun pq_lar = u3h(q_lar);
u3_noun qq_lar = u3t(q_lar);
u3_noun p_vug = u3h(vug);
u3_noun q_vug = u3t(vug);
u3_noun pq_vug = u3h(q_vug);
u3_noun qq_vug = u3t(q_vug);
if ( c3a(u3r_sing(p_lar, p_vug), u3r_sing(pq_lar, pq_vug)) ) {
u3m_error("mull-bonk-e");
}
{
u3_noun mew = rig;
u3_noun yom = _mull_edit
(van, sut, dox, mew, u3k(qq_lar),
u3k(qq_vug));
u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0);
u3_noun p_ret = u3qfu_fire(van, sut, u3h(yom));
u3_noun q_ret = u3qfu_fire(von, sut, u3t(yom));
u3z(von);
u3z(yom);
u3z(vug);
u3z(lar);
return u3nc(_mull_nice(van, gol, p_ret), q_ret);
}
}
#endif
# define _mull_used() # define _mull_used()
static u3_noun static u3_noun
@ -327,35 +350,14 @@
return ret; return ret;
} }
case c3__bcpt: u3x_cell(u3t(gen), &p_gen, &q_gen); case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun sep = u3qfu_seep(van, sut, c3__read, p_gen); u3_noun heb = u3nc(c3__herb, u3k(p_gen));
u3_noun pox = u3qfu_seep(van, dox, c3__read, p_gen); u3_noun nob = u3qfl_bunt(van, heb);
u3_noun axe = u3h(sep);
if ( axe != u3h(pox) ) {
return u3m_error("mull-bonk-wing");
}
else {
u3_noun rex = u3qfl_whip(van, q_gen, axe);
u3_noun ret = _mull_in(van, sut, gol, dox, rex);
u3z(sep);
u3z(pox);
u3z(rex);
return ret;
}
}
case c3__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun nob = u3qfl_bunt(van, p_gen);
u3_noun p_waz = u3qfu_play(van, sut, nob); u3_noun p_waz = u3qfu_play(van, sut, nob);
u3_noun q_waz = u3qfu_play(van, dox, nob); u3_noun q_waz = u3qfu_play(van, dox, nob);
u3_noun dok = u3nc(c3__cnzz, u3k(q_gen)); u3_noun dok = u3nc(c3__wing, u3k(q_gen));
u3_noun p_syx = _mull_doke(van, sut, dok); u3_noun p_syx = _mull_doke(van, sut, dok);
u3_noun q_syx = _mull_doke(van, dox, dok); u3_noun q_syx = _mull_doke(van, dox, dok);
u3_noun p_pov = u3qfu_fish(van, p_waz, p_syx); u3_noun p_pov = u3qfu_fish(van, p_waz, p_syx);
@ -371,11 +373,12 @@
u3z(p_pov); u3z(q_pov); u3z(p_pov); u3z(q_pov);
u3z(nob); u3z(nob);
u3z(dok); u3z(dok);
u3z(heb);
return _mull_both(van, gol, _mull_bean()); return _mull_both(van, gol, _mull_bean());
} }
case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); case c3__if: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mull_used(); _mull_used();
{ {
u3_noun bol = _mull_bean(); u3_noun bol = _mull_bean();
@ -408,8 +411,8 @@
} }
else ran = _mull_in(van, p_wux, gol, q_wux, r_gen); else ran = _mull_in(van, p_wux, gol, q_wux, r_gen);
dis = u3qf_fork(u3h(hiq), u3h(ran)); dis = u3qf_forq(u3h(hiq), u3h(ran));
dat = u3qf_fork(u3t(hiq), u3t(ran)); dat = u3qf_forq(u3t(hiq), u3t(ran));
ret = u3nc(_mull_nice(van, gol, dis), dat); ret = u3nc(_mull_nice(van, gol, dis), dat);
@ -424,7 +427,8 @@
return ret; return ret;
} }
case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__cons: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen);
@ -438,7 +442,8 @@
return ret; return ret;
} }
case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__same: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen);
@ -449,7 +454,8 @@
return _mull_both(van, gol, _mull_bean()); return _mull_both(van, gol, _mull_bean());
} }
case c3__dtwt: p_gen = u3t(gen);
case c3__deep: p_gen = u3t(gen);
_mull_used(); _mull_used();
{ {
u3_noun vay = _mull_in(van, sut, c3__noun, dox, p_gen); u3_noun vay = _mull_in(van, sut, c3__noun, dox, p_gen);
@ -457,36 +463,39 @@
u3z(vay); u3z(vay);
return _mull_both(van, gol, _mull_bean()); return _mull_both(van, gol, _mull_bean());
} }
case c3__dtkt: p_gen = u3t(gen);
case c3__wish: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun wuq = c3__noun; u3_noun nog = u3nc(c3__bunt, u3k(p_gen));
u3_noun vay = _mull_in(van, sut, c3__noun, dox, q_gen);
u3_noun ret;
u3z(vay);
ret = _mull_in(van, sut, gol, dox, nog);
u3z(nog);
return ret;
}
case c3__bump: p_gen = u3t(gen);
_mull_used();
{
u3_noun wuq = u3nt(c3__atom, u3_blip, u3_nul);
u3_noun vay = _mull_in(van, sut, wuq, dox, p_gen); u3_noun vay = _mull_in(van, sut, wuq, dox, p_gen);
u3z(vay); u3z(vay);
return _mull_both(van, gol, wuq); return _mull_both(van, gol, wuq);
} }
case c3__dtls: p_gen = u3t(gen);
case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun wuq = u3nc(c3__atom, u3_blip); u3_noun typ = u3qfu_play(van, sut, gen);
u3_noun vay = _mull_in(van, sut, wuq, dox, p_gen);
u3z(vay); return _mull_both(van, gol, typ);
return _mull_both(van, gol, wuq);
} }
case c3__dtzz: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun tof = u3nt(c3__cube,
u3k(q_gen),
(c3y == u3du(q_gen))
? c3__noun
: u3nc(c3__atom, u3k(p_gen)));
return _mull_both(van, gol, tof); case c3__nock: u3x_cell(u3t(gen), &p_gen, &q_gen);
}
case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen);
@ -497,13 +506,21 @@
return _mull_both(van, gol, c3__noun); return _mull_both(van, gol, c3__noun);
} }
case c3__dtzy: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun typ = u3qfu_play(van, sut, gen); u3_noun typ = u3qfu_play(van, sut, gen);
return _mull_both(van, gol, typ); return _mull_both(van, gol, typ);
} }
case c3__ktbr: p_gen = u3t(gen);
case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
return u3nc(u3k(p_gen), u3k(p_gen));
}
case c3__iron: p_gen = u3t(gen);
_mull_used(); _mull_used();
{ {
u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); u3_noun vat = _mull_in(van, sut, gol, dox, p_gen);
@ -517,7 +534,8 @@
u3z(vat); u3z(vat);
return pro; return pro;
} }
case c3__ktpm: p_gen = u3t(gen);
case c3__zinc: p_gen = u3t(gen);
_mull_used(); _mull_used();
{ {
u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); u3_noun vat = _mull_in(van, sut, gol, dox, p_gen);
@ -531,7 +549,8 @@
u3z(vat); u3z(vat);
return pro; return pro;
} }
case c3__ktwt: p_gen = u3t(gen);
case c3__lead: p_gen = u3t(gen);
_mull_used(); _mull_used();
{ {
u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); u3_noun vat = _mull_in(van, sut, gol, dox, p_gen);
@ -545,7 +564,8 @@
u3z(vat); u3z(vat);
return pro; return pro;
} }
case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__name: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); u3_noun vat = _mull_in(van, sut, gol, dox, q_gen);
@ -555,46 +575,26 @@
u3z(vat); u3z(vat);
return ret; return ret;
} }
case c3__ktzp: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun vat = _mull_in(van, sut, gol, dox, q_gen);
u3_noun ret =u3nc(u3qfu_conk(van, u3h(vat), p_gen),
u3qfu_conk(van, u3t(vat), p_gen));
u3z(vat); case c3__burn: p_gen = u3t(gen);
return ret;
}
case c3__ktsg: p_gen = u3t(gen);
_mull_used(); _mull_used();
{ {
return _mull_in(van, sut, gol, dox, p_gen); return _mull_in(van, sut, gol, dox, p_gen);
} }
case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__like: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen)); u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen));
u3_noun q_hif = u3qfu_play(van, dox, p_gen); u3_noun q_hif = u3qfu_play(van, dox, p_gen);
u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen); u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen);
u3_noun ret = u3nc(p_hif, q_hif); u3_noun ret = u3nc(p_hif, q_hif);
u3z(zel); u3z(zel);
return ret; return ret;
} }
case c3__kthx: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen));
u3_noun q_hif = u3qfu_play(van, dox, p_gen);
u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen); case c3__per: u3x_cell(u3t(gen), &p_gen, &q_gen);
u3_noun ret = u3nc(p_hif, q_hif);
u3z(zel);
return ret;
}
case c3__tsgr: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun lem = _mull_in(van, sut, c3__noun, dox, p_gen); u3_noun lem = _mull_in(van, sut, c3__noun, dox, p_gen);
@ -605,73 +605,27 @@
u3z(lem); u3z(lem);
return ret; return ret;
} }
case c3__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
case c3__aka: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mull_used(); _mull_used();
{ {
u3_noun sep = u3qfu_seep(van, sut, c3__both, q_gen); u3_noun boc = u3qfu_buss(van, sut, p_gen, q_gen);
u3_noun pox = u3qfu_seep(van, dox, c3__both, q_gen); u3_noun nuf = u3qfu_buss(van, dox, p_gen, q_gen);
u3_noun bid = u3nt(u3k(p_gen), u3k(q_gen), sep);
u3_noun yub = u3nt(u3k(p_gen), u3k(q_gen), pox);
u3_noun boc = u3qf_bull(bid, sut);
u3_noun nuf = u3qf_bull(yub, dox);
u3_noun ret = _mull_in(van, boc, gol, nuf, r_gen); u3_noun ret = _mull_in(van, boc, gol, nuf, r_gen);
u3z(bid);
u3z(yub);
u3z(boc); u3z(boc);
u3z(nuf); u3z(nuf);
return ret; return ret;
} }
case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__make: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun sec = u3qfu_seek(van, sut, c3__read, p_gen); return _mull_cnts(van, sut, gol, dox, p_gen, q_gen);
u3_noun suc = u3qfu_seek(van, dox, c3__read, p_gen);
u3_noun lar = _mull_foil(sec);
u3_noun p_lar = u3h(lar);
u3_noun q_lar = u3t(lar);
u3_noun pq_lar = u3h(q_lar);
u3_noun qq_lar = u3t(q_lar);
u3_noun vug = _mull_foil(suc);
u3_noun p_vug = u3h(vug);
u3_noun q_vug = u3t(vug);
u3_noun pq_vug = u3h(q_vug);
u3_noun qq_vug = u3t(q_vug);
if ( c3a(u3r_sing(p_lar, p_vug), u3r_sing(pq_lar, pq_vug)) ) {
u3m_error("mull-bonk-e");
}
{
u3_noun mew = u3qfu_snub(van, sut, q_gen);
u3_noun yom = _mull_edit
(van, sut, dox, mew, u3k(qq_lar),
u3k(qq_vug));
u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0);
u3_noun p_ret = u3qfu_fire(van, sut, u3h(yom));
u3_noun q_ret = u3qfu_fire(von, sut, u3t(yom));
u3z(von);
u3z(yom);
u3z(mew);
u3z(vug);
u3z(lar);
return u3nc(_mull_nice(van, gol, p_ret), q_ret);
}
} }
case c3__pmcl: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun ruf = u3nt(c3__clhp,
u3nc(u3_nul, 1),
u3k(p_gen));
u3_noun ret = _mull_grow(van, sut, gol, dox, c3__zinc, ruf, q_gen);
u3z(ruf); case c3__core: p_gen = u3t(gen);
return ret;
}
case c3__brcn: p_gen = u3t(gen);
_mull_used(); _mull_used();
{ {
u3_noun ruf = u3nc(u3_nul, 1); u3_noun ruf = u3nc(u3_nul, 1);
@ -681,28 +635,8 @@
return ret; return ret;
} }
case c3__pmcn: p_gen = u3t(gen);
_mull_used();
{
u3_noun ruf = u3nc(u3_nul, 1);
ret = _mull_grow(van, sut, gol, dox, c3__lead, ruf, p_gen); case c3__peep: u3x_cell(u3t(gen), &p_gen, &q_gen);
u3z(ruf);
return ret;
}
case c3__pmls: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun ruf = u3nt(c3__clhp,
u3nc(u3_nul, 1),
u3k(p_gen));
u3_noun ret = _mull_grow(van, sut, gol, dox, c3__iron, ruf, q_gen);
u3z(ruf);
return ret;
}
case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun typ = u3qfu_play(van, sut, p_gen); u3_noun typ = u3qfu_play(van, sut, p_gen);
@ -718,12 +652,14 @@
u3z(typ); u3z(typ);
return ret; return ret;
} }
case c3__sggr: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__hint: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
return _mull_in(van, sut, gol, dox, q_gen); return _mull_in(van, sut, gol, dox, q_gen);
} }
case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__twig: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun p_ret = u3qfu_play(van, sut, p_gen); u3_noun p_ret = u3qfu_play(van, sut, p_gen);
@ -732,7 +668,8 @@
return u3nc(_mull_nice(van, gol, p_ret), return u3nc(_mull_nice(van, gol, p_ret),
q_ret); q_ret);
} }
case c3__zpcb: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen);
{ {
u3_noun ret; u3_noun ret;
@ -743,21 +680,14 @@
u3t_drop(); u3t_drop();
return ret; return ret;
} }
case c3__zpts: p_gen = u3t(gen);
case c3__code: p_gen = u3t(gen);
_mull_used(); _mull_used();
{ {
return _mull_both(van, gol, c3__noun); return _mull_both(van, gol, c3__noun);
} }
case c3__zpcn:
_mull_used();
{
u3_noun pet = u3j_hook(u3k(van), "seed");
u3_noun peq = u3k(u3h(pet));
u3z(pet); case c3__spit: u3x_cell(u3t(gen), &p_gen, &q_gen);
return _mull_both(van, gol, peq);
}
case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used(); _mull_used();
{ {
u3_noun p_zur = u3qfu_play(van, sut, p_gen); u3_noun p_zur = u3qfu_play(van, sut, p_gen);
@ -773,8 +703,9 @@
return u3nc return u3nc
(_mull_nice(van, gol, p_ret), q_ret); (_mull_nice(van, gol, p_ret), q_ret);
} }
case c3__zpfs:
case c3__zpzp: case c3__lost:
case c3__fail:
_mull_used(); _mull_used();
{ {
return u3nc(c3__void, c3__void); return u3nc(c3__void, c3__void);
@ -789,14 +720,7 @@
u3_noun dox, u3_noun dox,
u3_noun gen) u3_noun gen)
{ {
if ( c3n == _mull_vet(van) ) { return _mull_in(van, sut, gol, dox, gen);
return c3y;
} else {
u3_noun mul = _mull_in(van, sut, gol, dox, gen);
u3z(mul);
return c3y;
}
} }
/* boilerplate /* boilerplate
@ -826,7 +750,7 @@
u3_noun dox, u3_noun dox,
u3_noun gen) u3_noun gen)
{ {
c3_m fun_m = c3__mull; c3_m fun_m = c3__mull + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen); u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen);
if ( u3_none != pro ) { if ( u3_none != pro ) {

View File

@ -3,18 +3,17 @@
*/ */
#include "all.h" #include "all.h"
/* logic /* logic
*/ */
/* forward /* forward
*/ */
static u3_noun static u3_noun
_nest_sint(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); _nest_sint(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun static u3_noun
_nest_dext(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); _nest_dext(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun static u3_noun
_nest_cram(u3_noun van, _nest_clip(u3_noun van,
u3_noun sut, u3_noun sut,
u3_noun tel, u3_noun tel,
u3_noun ref, u3_noun ref,
@ -34,8 +33,9 @@
u3x_trel(dab, &n_dab, &l_dab, &r_dab); u3x_trel(dab, &n_dab, &l_dab, &r_dab);
u3x_trel(hem, &n_hem, &l_hem, &r_hem); u3x_trel(hem, &n_hem, &l_hem, &r_hem);
if ( (c3n == _nest_cram(van, sut, tel, ref, l_dab, l_hem, gil)) || if ( (c3n == _nest_clip(van, sut, tel, ref, l_dab, l_hem, gil)) ||
(c3n == _nest_cram(van, sut, tel, ref, r_dab, r_hem, gil)) ) { (c3n == _nest_clip(van, sut, tel, ref, r_dab, r_hem, gil)) )
{
return c3n; return c3n;
} }
u3x_cell(n_dab, &pn_dab, &qn_dab); u3x_cell(n_dab, &pn_dab, &qn_dab);
@ -57,7 +57,8 @@
u3_noun pqn_hem = u3t(qn_hem); u3_noun pqn_hem = u3t(qn_hem);
u3_noun vis = u3qfu_play(van, sut, pqn_dab); u3_noun vis = u3qfu_play(van, sut, pqn_dab);
u3_noun lon = u3qfu_play(van, ref, pqn_hem); u3_noun lon = u3qfu_play(van, ref, pqn_hem);
u3_noun ret = _nest_dext(van, vis, tel, lon, gil);
u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil);
u3z(vis); u3z(vis);
u3z(lon); u3z(lon);
@ -95,16 +96,22 @@
u3x_cell(rq_ref, &prq_ref, &qrq_ref); u3x_cell(rq_ref, &prq_ref, &qrq_ref);
if ( c3y == u3r_sing(q_sut, q_ref) ) { if ( c3y == u3r_sing(q_sut, q_ref) ) {
return _nest_dext(van, p_sut, tel, p_ref, gil); return _nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil);
} }
else if ( (c3n == _nest_dext(van, qq_sut, tel, p_sut, gil)) || else if ( (c3n == _nest_dext
(c3n == _nest_dext(van, p_sut, tel, qq_sut, gil)) || (van, qq_sut, tel, p_sut, u3_nul, u3_nul, gil)) ||
(c3n == _nest_dext(van, qq_ref, tel, p_ref, gil)) ) (c3n == _nest_dext
(van, p_sut, tel, qq_sut, u3_nul, u3_nul, gil)) ||
(c3n == _nest_dext
(van, qq_ref, tel, p_ref, u3_nul, u3_nul, gil)) )
{ {
return c3n; return c3n;
} }
else { else {
if ( (pq_sut != pq_ref) && (c3__gold != pq_ref) ) { if ( (pq_sut != pq_ref) &&
(c3__lead != pq_sut) &&
(c3__gold != pq_ref) )
{
return c3n; return c3n;
} }
else { else {
@ -119,12 +126,15 @@
u3_noun zoc = u3qdi_put(gil, hud); u3_noun zoc = u3qdi_put(gil, hud);
u3_noun tus = u3nt(c3__core, u3_noun tus = u3nt(c3__core,
u3k(qq_sut), u3k(qq_sut),
u3k(q_sut)); u3nc(c3__gold,
u3k(u3t(q_sut))));
u3_noun fer = u3nt(c3__core, u3_noun fer = u3nt(c3__core,
u3k(qq_ref), u3k(qq_ref),
u3k(q_ref)); u3nc(c3__gold,
u3k(u3t(q_ref))));
ret = _nest_cram(van, tus, tel, fer, qrq_sut, qrq_ref, zoc); ret = _nest_clip(van, tus, tel, fer, qrq_sut, qrq_ref, zoc);
u3z(fer); u3z(fer);
u3z(tus); u3z(tus);
u3z(zoc); u3z(zoc);
@ -139,13 +149,14 @@
case c3__gold: { case c3__gold: {
return return
c3a(_nest_dext(van, qq_sut, tel, qq_ref, gil), c3a(_nest_dext(van, qq_sut, tel, qq_ref, u3_nul, u3_nul, gil),
_nest_dext(van, qq_ref, tel, qq_sut, gil)); _nest_dext(van, qq_ref, tel, qq_sut, u3_nul, u3_nul, gil));
} }
case c3__iron: { case c3__iron: {
u3_noun s_sam = u3qfu_peek(van, qq_sut, c3__rite, 2); u3_noun s_sam = u3qfu_peek(van, qq_sut, c3__rite, 2);
u3_noun r_sam = u3qfu_peek(van, qq_ref, c3__rite, 2); u3_noun r_sam = u3qfu_peek(van, qq_ref, c3__rite, 2);
u3_noun ret = _nest_dext(van, r_sam, tel, s_sam, gil); u3_noun ret = _nest_dext
(van, r_sam, tel, s_sam, u3_nul, u3_nul, gil);
u3z(r_sam); u3z(r_sam);
u3z(s_sam); u3z(s_sam);
@ -157,7 +168,8 @@
case c3__zinc: { case c3__zinc: {
u3_noun s_pal = u3qfu_peek(van, qq_sut, c3__read, 2); u3_noun s_pal = u3qfu_peek(van, qq_sut, c3__read, 2);
u3_noun r_pal = u3qfu_peek(van, qq_ref, c3__read, 2); u3_noun r_pal = u3qfu_peek(van, qq_ref, c3__read, 2);
u3_noun ret = _nest_dext(van, s_pal, tel, r_pal, gil); u3_noun ret = _nest_dext
(van, s_pal, tel, r_pal, u3_nul, u3_nul, gil);
u3z(r_pal); u3z(r_pal);
u3z(s_pal); u3z(s_pal);
@ -176,6 +188,8 @@
u3_noun sut, u3_noun sut,
u3_noun tel, u3_noun tel,
u3_noun ref, u3_noun ref,
u3_noun seg,
u3_noun reg,
u3_noun gil) u3_noun gil)
{ {
u3_noun p_sut, q_sut, p_ref, q_ref; u3_noun p_sut, q_sut, p_ref, q_ref;
@ -187,28 +201,28 @@
return c3y; return c3y;
} }
case c3__void: { case c3__void: {
return _nest_sint(van, sut, tel, ref, gil); return _nest_sint(van, sut, tel, ref, seg, reg, gil);
} }
} }
else switch ( u3h(sut) ) { else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail); default: return u3m_bail(c3__fail);
case c3__atom: { case c3__atom: {
if ( (c3y == u3du(ref)) && (c3__atom == u3h(ref)) ) {
if ( c3n == u3qf_fitz(u3t(sut), u3t(ref)) ) {
// u3_err("fitz: need", u3t(sut));
// u3_err("fitz: have", u3t(ref));
return c3n;
}
return c3y;
}
else return _nest_sint(van, sut, tel, ref, gil);
}
case c3__bull: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} else { }
return _nest_dext(van, q_sut, tel, ref, gil); else {
if ( c3y == u3r_pq(ref, c3__atom, &p_ref, &q_ref) ) {
if ( (c3n == u3qf_fitz(p_sut, p_ref)) ||
( (c3y == u3du(q_sut)) &&
( (c3n == u3du(q_ref)) ||
(c3n == u3r_sing(q_sut, q_ref)))) )
{
return c3n;
}
return c3y;
}
return _nest_sint(van, sut, tel, ref, seg, reg, gil);
} }
} }
case c3__cell: { case c3__cell: {
@ -216,10 +230,10 @@
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} else { } else {
if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) { if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) {
return c3a(_nest_dext(van, p_sut, tel, p_ref, gil), return c3a(_nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil),
_nest_dext(van, q_sut, tel, q_ref, gil)); _nest_dext(van, q_sut, tel, q_ref, u3_nul, u3_nul, gil));
} }
else return _nest_sint(van, sut, tel, ref, gil); else return _nest_sint(van, sut, tel, ref, seg, reg, gil);
} }
} }
case c3__core: { case c3__core: {
@ -229,69 +243,75 @@
if ( (c3y == u3r_pq(ref, c3__core, &p_ref, &q_ref)) ) { if ( (c3y == u3r_pq(ref, c3__core, &p_ref, &q_ref)) ) {
return _nest_cong(van, sut, tel, ref, gil); return _nest_cong(van, sut, tel, ref, gil);
} }
else return _nest_sint(van, sut, tel, ref, gil); else return _nest_sint(van, sut, tel, ref, seg, reg, gil);
}
}
case c3__cube: {
if ( c3n == u3r_trel(sut, 0, &p_sut, &q_sut) ) {
return u3m_bail(c3__fail);
} else {
if ( c3y == u3r_pq(ref, c3__cube, &p_ref, &q_ref) ) {
return u3r_sing(p_sut, p_ref);
}
else return _nest_sint(van, sut, tel, ref, gil);
} }
} }
case c3__face: { case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} else { } else {
return _nest_dext(van, q_sut, tel, ref, gil); return _nest_dext(van, q_sut, tel, ref, seg, reg, gil);
} }
} }
case c3__fork: { case c3__fork: p_sut = u3t(sut);
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { {
return u3m_bail(c3__fail); if ( c3n == u3du(ref) ) switch ( ref ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__noun:
break;
}
else switch ( u3h(ref) ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__atom:
case c3__cell:
case c3__core:
break;
}
{
u3_noun dey = u3qdi_tap(p_sut, u3_nul);
u3_noun yed = dey;
while ( u3_nul != yed ) {
if ( c3y == _nest_dext(van, u3h(yed), c3n, ref, seg, reg, gil) ) {
u3z(dey);
return c3y;
} else {
yed = u3t(yed);
}
}
u3z(dey);
return c3n;
}
}
case c3__hold:
{
if ( c3y == u3qdi_has(seg, sut) ) {
return c3n;
} }
else { else {
if ( c3n == u3du(ref) ) switch ( ref ) { u3_noun hud = u3nc(u3k(sut), u3k(ref));
default: return _nest_sint(van, sut, tel, ref, gil);
case c3__noun: if ( (c3y == u3qdi_has(gil, hud)) ) {
break; u3z(hud);
return c3y;
}
else {
u3_noun gus = u3qdi_put(seg, sut);
u3_noun zoc = u3qdi_put(gil, hud);
u3_noun fop = u3qfu_repo(van, sut);
u3_noun hiv = _nest_dext(van, fop, tel, ref, gus, reg, zoc);
u3z(hud);
u3z(fop);
u3z(zoc);
u3z(gus);
return hiv;
} }
else switch ( u3h(ref) ) {
default: return _nest_sint(van, sut, tel, ref, gil);
case c3__atom:
case c3__cell:
case c3__cube:
case c3__core:
break;
}
return c3o(_nest_dext(van, p_sut, c3n, ref, gil),
_nest_dext(van, q_sut, c3n, ref, gil));
}
}
case c3__hold: p_sut = u3t(sut);
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));
if ( (c3y == u3qdi_has(gil, hud)) ) {
u3z(hud);
return c3y;
} else {
u3_noun zoc = u3qdi_put(gil, hud);
u3_noun fop = u3qfu_rest(van, sut, p_sut);
u3_noun hiv = _nest_dext(van, fop, tel, ref, zoc);
u3z(hud);
u3z(fop);
u3z(zoc);
return hiv;
} }
} }
} }
@ -302,20 +322,23 @@
u3_noun sut, u3_noun sut,
u3_noun tel, u3_noun tel,
u3_noun ref, u3_noun ref,
u3_noun seg,
u3_noun reg,
u3_noun gil) u3_noun gil)
{ {
u3_noun tyn = _nest_dext_in(van, sut, tel, ref, gil); u3_noun tyn = _nest_dext_in(van, sut, tel, ref, seg, reg, gil);
if ( (c3y == tyn) || (c3n == tel) ) { if ( (c3y == tyn) || (c3n == tel) ) {
return tyn; return tyn;
} else { } else {
// u3_noun dun = u3qfu_dunq(van, "need", sut); #if 0
// u3_noun niz = u3qfu_dunq(van, "have", ref); u3_noun dun = u3qfu_dunq(van, "need", sut);
u3_noun niz = u3qfu_dunq(van, "have", ref);
// u3t_push(u3nc(c3__mean, dun)); u3t_push(u3nc(c3__mean, dun));
// u3t_push(u3nc(c3__mean, niz)); u3t_push(u3nc(c3__mean, niz));
#endif
return u3m_error("type-fail"); return u3m_error("nest-fail");
} }
} }
@ -324,6 +347,8 @@
u3_noun sut, u3_noun sut,
u3_noun tel, u3_noun tel,
u3_noun ref, u3_noun ref,
u3_noun seg,
u3_noun reg,
u3_noun gil) u3_noun gil)
{ {
@ -332,16 +357,21 @@
} }
{ {
c3_m fun_m = c3__nest; c3_m fun_m = c3__nest + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find_2(fun_m, sut, ref); u3_noun pro = u3z_find_2(fun_m, sut, ref);
if ( u3_none != pro ) { if ( u3_none != pro ) {
return pro; return pro;
} }
else { else {
pro = _nest_dext_to(van, sut, tel, ref, gil); pro = _nest_dext_to(van, sut, tel, ref, seg, reg, gil);
return u3z_save_2(fun_m, sut, ref, pro); if ( ((c3y == pro) && (u3_nul == reg)) ||
((c3n == pro) && (u3_nul == seg)) )
{
return u3z_save_2(fun_m, sut, ref, pro);
}
else return pro;
} }
} }
} }
@ -351,6 +381,8 @@
u3_noun sut, u3_noun sut,
u3_noun tel, u3_noun tel,
u3_noun ref, u3_noun ref,
u3_noun seg,
u3_noun reg,
u3_noun gil) u3_noun gil)
{ {
u3_noun p_ref, q_ref; u3_noun p_ref, q_ref;
@ -369,62 +401,60 @@
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} }
case c3__atom: return c3n; case c3__atom: return c3n;
case c3__bull: {
if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) {
return u3m_bail(c3__fail);
} else {
return _nest_dext(van, sut, tel, q_ref, gil);
}
}
case c3__cell: return c3n; case c3__cell: return c3n;
case c3__core: { case c3__core: {
u3_noun gam = u3qfu_repo(van, ref); u3_noun gam = u3qfu_repo(van, ref);
u3_noun hiv = _nest_dext(van, sut, tel, gam, gil); u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil);
u3z(gam); u3z(gam);
return hiv; return hiv;
} }
case c3__cube: {
if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) {
return u3m_bail(c3__fail);
} else {
return _nest_dext(van, sut, tel, q_ref, gil);
}
}
case c3__face: { case c3__face: {
if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) { if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} else { } else {
return _nest_dext(van, sut, tel, q_ref, gil); return _nest_dext(van, sut, tel, q_ref, seg, reg, gil);
} }
} }
case c3__fork: { case c3__fork: p_ref = u3t(ref);
if ( (c3y == u3r_mean(ref, 6, &p_ref, 7, &q_ref, 0)) ) { {
return c3a(_nest_dext(van, sut, c3n, p_ref, gil), u3_noun dey = u3qdi_tap(p_ref, u3_nul);
_nest_dext(van, sut, c3n, q_ref, gil)); u3_noun yed = dey;
while ( u3_nul != yed ) {
if ( c3n == _nest_dext(van, sut, c3n, u3h(yed), seg, reg, gil) ) {
u3z(dey);
return c3n;
} else {
yed = u3t(yed);
}
} }
else return u3m_bail(c3__fail); u3z(dey);
return c3y;
} }
case c3__hold: { case c3__hold: {
p_ref = u3t(ref); if ( c3y == u3qdi_has(reg, ref) ) {
return c3y;
}
{ {
u3_noun hud = u3nc(u3k(sut), u3_noun hud = u3nc(u3k(sut), u3k(ref));
u3k(ref));
if ( (c3y == u3qdi_has(gil, hud)) ) { if ( (c3y == u3qdi_has(gil, hud)) ) {
u3z(hud); u3z(hud);
return c3y; return c3y;
} else { } else {
u3_noun gur = u3qdi_put(reg, ref);
u3_noun zoc = u3qdi_put(gil, hud); u3_noun zoc = u3qdi_put(gil, hud);
u3_noun gam = u3qfu_repo(van, ref); u3_noun gam = u3qfu_repo(van, ref);
{ {
u3_noun hiv = _nest_dext(van, sut, tel, gam, zoc); u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, gur, zoc);
u3z(hud); u3z(hud);
u3z(gam); u3z(gam);
u3z(zoc); u3z(zoc);
u3z(gur);
return hiv; return hiv;
} }
@ -441,7 +471,7 @@
u3_noun tel, u3_noun tel,
u3_noun ref) u3_noun ref)
{ {
return _nest_dext(van, sut, tel, ref, u3_nul); return _nest_dext(van, sut, tel, ref, u3_nul, u3_nul, u3_nul);
} }
/* boilerplate /* boilerplate

View File

@ -9,6 +9,21 @@
u3_noun u3_noun
_cqfu_peek(u3_noun, u3_noun, u3_noun, u3_atom); _cqfu_peek(u3_noun, u3_noun, u3_noun, u3_atom);
static u3_noun
_peek_in(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_peek_fork(u3_noun van, u3_noun p_sut, u3_noun way, u3_noun axe, u3_noun gil)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_peek_in(van, u3h(p_sut), way, axe, gil),
_peek_fork(van, u3t(p_sut), way, axe, gil));
}
}
static u3_noun static u3_noun
_peek_in(u3_noun van, _peek_in(u3_noun van,
u3_noun sut, u3_noun sut,
@ -35,13 +50,6 @@
case c3__atom: { case c3__atom: {
return c3__void; return c3__void;
} }
case c3__bull: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return _peek_in(van, q_sut, way, axe, gil);
}
}
case c3__cell: { case c3__cell: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
@ -97,13 +105,6 @@
return pro; return pro;
} }
} }
case c3__cube: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return _peek_in(van, q_sut, way, axe, gil);
}
}
case c3__face: { case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
@ -111,23 +112,15 @@
return _peek_in(van, q_sut, way, axe, gil); return _peek_in(van, q_sut, way, axe, gil);
} }
} }
case c3__fork: { case c3__fork: p_sut = u3t(sut);
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { {
return u3m_bail(c3__fail); u3_noun yed = u3qdi_tap(p_sut, u3_nul);
} else { u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil));
u3_noun hed = _peek_in(van, p_sut, way, axe, gil);
u3_noun tal = _peek_in(van, q_sut, way, axe, gil);
pro = u3qf_fork(hed, tal); u3z(yed);
return ret;
u3z(hed);
u3z(tal);
return pro;
}
} }
case c3__hold: { case c3__hold: {
p_sut = u3t(sut);
if ( (c3y == u3qdi_has(gil, sut)) ) { if ( (c3y == u3qdi_has(gil, sut)) ) {
return c3__void; return c3__void;
} }
@ -183,7 +176,7 @@
u3_noun way, u3_noun way,
u3_noun axe) u3_noun axe)
{ {
c3_m fun_m = c3__peek; c3_m fun_m = c3__peek + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find_3(fun_m, sut, way, axe); u3_noun pro = u3z_find_3(fun_m, sut, way, axe);
if ( u3_none != pro ) { if ( u3_none != pro ) {

55
jets/f/ut_perk.c Normal file
View File

@ -0,0 +1,55 @@
/* j/6/ut_perk.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqfu_perk(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun met)
{
if ( c3__gold == met ) {
return u3nc(c3y, c3y);
}
else switch ( way ) {
default: return u3m_bail(c3__fail);
case c3__both: return u3nc(c3n, c3n);
case c3__free: return u3nc(c3y, c3y);
case c3__read: return u3nc(((met == c3__zinc) ? c3y : c3n), c3n);
case c3__rite: return u3nc(((met == c3__iron) ? c3y : c3n), c3n);
}
}
/* boilerplate
*/
u3_noun
u3wfu_perk(u3_noun cor)
{
u3_noun sut, way, met, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &way,
u3x_sam_3, &met,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_perk(van, sut, way, met);
}
}
u3_noun
u3qfu_perk(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun met)
{
return _cqfu_perk(van, sut, way, met);
}

View File

@ -3,7 +3,6 @@
*/ */
#include "all.h" #include "all.h"
/* logic /* logic
*/ */
# define _play_used() # define _play_used()
@ -12,11 +11,38 @@
_play_in(u3_noun, u3_noun, u3_noun); _play_in(u3_noun, u3_noun, u3_noun);
static u3_noun static u3_noun
_play_bean(void) _play_bean()
{ {
return u3nt(c3__fork, return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__cube, 0, c3__atom, 'f'), u3nq(c3__atom, 'f', u3_nul, 1),
u3nq(c3__cube, 1, c3__atom, 'f')); u3_nul));
}
static u3_noun
_play_rock(u3_noun odo, u3_noun bob)
{
if ( c3y == u3ud(bob) ) {
return u3nq(c3__atom, u3k(odo), u3_nul, u3k(bob));
}
else return u3nt(c3__cell, _play_rock(odo, u3h(bob)),
_play_rock(odo, u3t(bob)));
}
static u3_noun
_play_sand(u3_noun odo, u3_noun bob)
{
if ( c3y == u3ud(bob) ) {
if ( 'f' == odo ) {
if ( (bob > 1) ) {
return u3m_bail(c3__exit);
} else {
return _play_bean();
}
}
return u3nt(c3__atom, u3k(odo), u3_nul);
}
else return u3nt(c3__cell, _play_rock(odo, u3h(bob)),
_play_rock(odo, u3t(bob)));
} }
static u3_noun static u3_noun
@ -46,34 +72,24 @@
return ret; return ret;
} }
#if 1
static u3_noun static u3_noun
_play_foil(u3_noun pok) _play_cnts(u3_noun van,
u3_noun sut,
u3_noun hyp,
u3_noun rig)
{ {
u3_noun p_pok = u3h(pok); u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun q_pok = u3t(pok); u3_noun gat = u3j_hook(von, "epla");
u3_noun ret;
if ( c3y == u3h(q_pok) ) { return u3n_kick_on(u3i_molt(gat,
u3_noun pq_pok = u3t(q_pok); u3x_sam_2,
u3k(hyp),
ret = u3nc(u3k(p_pok), u3x_sam_3,
u3nc(u3_nul, u3k(rig),
u3nc(u3nc(u3k(pq_pok), 0));
u3nt(c3__elm, u3_nul, 1)),
u3_nul)));
}
else {
u3_noun pq_pok = u3h(u3t(q_pok));
u3_noun qq_pok = u3t(u3t(q_pok));
ret = u3nc(u3k(p_pok),
u3nc(u3k(pq_pok),
u3k(qq_pok)));
}
u3z(pok);
return ret;
} }
#else
static u3_noun static u3_noun
_play_edit(u3_noun van, _play_edit(u3_noun van,
u3_noun sut, u3_noun sut,
@ -89,7 +105,7 @@
u3_noun pi_mew = u3h(i_mew); u3_noun pi_mew = u3h(i_mew);
u3_noun qi_mew = u3t(i_mew); u3_noun qi_mew = u3t(i_mew);
u3_noun laf = _play_in(van, sut, qi_mew); u3_noun laf = _play_in(van, sut, qi_mew);
u3_noun ruz = u3qfu_tock(van, sut, pi_mew, laf, rag); u3_noun ruz = u3qfu_toss(van, sut, pi_mew, laf, rag);
u3z(laf); u3z(laf);
u3z(rag); u3z(rag);
@ -100,6 +116,25 @@
} }
} }
} }
static u3_noun
_play_cnts_old(u3_noun van,
u3_noun sut,
u3_noun hyp,
u3_noun rig)
{
u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp);
u3_noun q_lar = u3t(lar);
u3_noun qq_lar = u3t(q_lar);
u3_noun mew = rig;
u3_noun rag = _play_edit(van, sut, mew, u3k(qq_lar));
u3_noun ret = u3qfu_fire(van, sut, rag);
u3z(rag);
u3z(lar);
return ret;
}
#endif
static u3_noun static u3_noun
_play_grow(u3_noun van, _play_grow(u3_noun van,
@ -183,25 +218,13 @@
else switch ( u3h(gen) ) { else switch ( u3h(gen) ) {
default: goto open; default: goto open;
case c3__bcpt: u3x_cell(u3t(gen), &p_gen, &q_gen); case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun sep = u3qfu_seep(van, sut, c3__read, p_gen);
u3_noun axe = u3h(sep);
u3_noun rex = u3qfl_whip(van, q_gen, axe);
u3_noun ret = _play_x(van, sut, rex);
u3z(sep);
u3z(rex);
return ret;
}
case c3__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
return _play_bean(); return _play_bean();
} }
case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
case c3__if: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_play_used(); _play_used();
{ {
u3_noun fex = u3qfu_gain(van, sut, p_gen); u3_noun fex = u3qfu_gain(van, sut, p_gen);
@ -210,13 +233,14 @@
: _play_x(van, fex, q_gen); : _play_x(van, fex, q_gen);
u3_noun doz = (wux == c3__void) ? c3__void u3_noun doz = (wux == c3__void) ? c3__void
: _play_x(van, wux, r_gen); : _play_x(van, wux, r_gen);
u3_noun ret = u3qf_fork(dez, doz); u3_noun ret = u3qf_forq(dez, doz);
u3z(dez); u3z(doz); u3z(dez); u3z(doz);
u3z(fex); u3z(wux); u3z(fex); u3z(wux);
return ret; return ret;
} }
case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__cons: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
u3_noun dis = _play_x(van, sut, p_gen); u3_noun dis = _play_x(van, sut, p_gen);
@ -227,55 +251,60 @@
u3z(dat); u3z(dat);
return ret; return ret;
} }
case c3__dtkt: p_gen = u3t(gen);
_play_used();
{
return c3__noun;
}
case c3__dtwt: p_gen = u3t(gen);
_play_used();
{
return _play_bean();
}
case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
return _play_bean();
}
case c3__dtls: p_gen = u3t(gen);
_play_used();
{
return u3nc(c3__atom, u3_blip);
}
case c3__dtzz: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun boc = (c3n == u3ud(q_gen))
? c3__noun
: u3nc(c3__atom, u3k(p_gen));
u3_noun ret = u3qf_cube(q_gen, boc);
u3z(boc); case c3__wish: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun nog = u3nc(c3__bunt, u3k(p_gen));
u3_noun ret = _play_x(van, sut, nog);
u3z(nog);
return ret; return ret;
} }
case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__deep: p_gen = u3t(gen);
_play_used();
{
return _play_bean();
}
case c3__same: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
return _play_bean();
}
case c3__bump: p_gen = u3t(gen);
_play_used();
{
return u3nt(c3__atom, u3_blip, u3_nul);
}
case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
return _play_rock(p_gen, q_gen);
}
case c3__nock: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
return c3__noun; return c3__noun;
} }
case c3__dtzy: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
if ( 'f' == p_gen ) { return _play_sand(p_gen, q_gen);
if ( (q_gen > 1) ) {
return u3m_bail(c3__exit);
} else {
return _play_bean();
}
}
else return u3nc(c3__atom, u3k(p_gen));
} }
case c3__ktbr: p_gen = u3t(gen);
case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
return u3k(p_gen);
}
case c3__iron: p_gen = u3t(gen);
_play_used(); _play_used();
{ {
u3_noun boc = _play_x(van, sut, p_gen); u3_noun boc = _play_x(van, sut, p_gen);
@ -284,7 +313,8 @@
u3z(boc); u3z(boc);
return pro; return pro;
} }
case c3__ktpm: p_gen = u3t(gen);
case c3__zinc: p_gen = u3t(gen);
_play_used(); _play_used();
{ {
u3_noun boc = _play_x(van, sut, p_gen); u3_noun boc = _play_x(van, sut, p_gen);
@ -293,7 +323,8 @@
u3z(boc); u3z(boc);
return pro; return pro;
} }
case c3__ktwt: p_gen = u3t(gen);
case c3__lead: p_gen = u3t(gen);
_play_used(); _play_used();
{ {
u3_noun boc = _play_x(van, sut, p_gen); u3_noun boc = _play_x(van, sut, p_gen);
@ -302,7 +333,8 @@
u3z(boc); u3z(boc);
return pro; return pro;
} }
case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__name: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
u3_noun boc = _play_x(van, sut, q_gen); u3_noun boc = _play_x(van, sut, q_gen);
@ -311,31 +343,20 @@
u3z(boc); u3z(boc);
return ret; return ret;
} }
case c3__ktzp: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun boc = _play_x(van, sut, q_gen);
u3_noun ret = u3qfu_conk(van, boc, p_gen);
u3z(boc); case c3__burn: p_gen = u3t(gen);
return ret;
}
case c3__ktsg: p_gen = u3t(gen);
_play_used(); _play_used();
{ {
return _play_x(van, sut, p_gen); return _play_x(van, sut, p_gen);
} }
case c3__kthx: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__like: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
return _play_x(van, sut, p_gen); return _play_x(van, sut, p_gen);
} }
case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); case c3__per: u3x_cell(u3t(gen), &p_gen, &q_gen);
{
return _play_x(van, sut, p_gen);
}
case c3__tsgr: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
u3_noun boc = _play_x(van, sut, p_gen); u3_noun boc = _play_x(van, sut, p_gen);
@ -344,48 +365,24 @@
u3z(boc); u3z(boc);
return ret; return ret;
} }
case c3__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
case c3__aka: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_play_used(); _play_used();
{ {
u3_noun sep = u3qfu_seep(van, sut, c3__both, q_gen); u3_noun boc = u3qfu_buss(van, sut, p_gen, q_gen);
u3_noun bid = u3nt(u3k(p_gen), u3k(q_gen), sep);
u3_noun boc = u3qf_bull(bid, sut);
u3_noun ret = _play_x(van, boc, r_gen); u3_noun ret = _play_x(van, boc, r_gen);
u3z(bid);
u3z(boc); u3z(boc);
return ret; return ret;
} }
case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__make: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
u3_noun sec = u3qfu_seek(van, sut, c3__read, p_gen); return _play_cnts(van, sut, p_gen, q_gen);
u3_noun lar = _play_foil(sec);
u3_noun q_lar = u3t(lar);
u3_noun qq_lar = u3t(q_lar);
u3_noun mew = u3qfu_snub(van, sut, q_gen);
u3_noun rag = _play_edit(van, sut, mew, u3k(qq_lar));
u3_noun ret = u3qfu_fire(van, sut, rag);
u3z(rag);
u3z(mew);
u3z(lar);
return ret;
} }
case c3__pmcl: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun ruf = u3nt(c3__clhp,
u3nc(u3_nul, 1),
u3k(p_gen));
u3_noun ret = _play_grow(van, sut, c3__zinc, ruf, q_gen);
u3z(ruf); case c3__core: p_gen = u3t(gen);
return ret;
}
case c3__brcn: p_gen = u3t(gen);
_play_used(); _play_used();
{ {
u3_noun ruf = u3nc(u3_nul, 1); u3_noun ruf = u3nc(u3_nul, 1);
@ -394,27 +391,8 @@
u3z(ruf); u3z(ruf);
return ret; return ret;
} }
case c3__pmcn: p_gen = u3t(gen);
_play_used();
{
u3_noun ruf = u3nc(u3_nul, 1);
u3_noun ret = _play_grow(van, sut, c3__lead, ruf, p_gen);
u3z(ruf); case c3__peep: u3x_cell(u3t(gen), &p_gen, &q_gen);
return ret;
}
case c3__pmls: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun ruf = u3nt(c3__clhp,
u3nc(u3_nul, 1),
u3k(p_gen));
u3_noun ret = _play_grow(van, sut, c3__iron, ruf, q_gen);
u3z(ruf);
return ret;
}
case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
u3_noun typ = u3qfu_play(van, sut, p_gen); u3_noun typ = u3qfu_play(van, sut, p_gen);
@ -430,22 +408,26 @@
u3z(typ); u3z(typ);
return ret; return ret;
} }
case c3__sggr: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__hint: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
return _play_x(van, sut, q_gen); return _play_x(van, sut, q_gen);
} }
case c3__zpts: p_gen = u3t(gen);
case c3__code: p_gen = u3t(gen);
_play_used(); _play_used();
{ {
return c3__noun; return c3__noun;
} }
case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__twig: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
return _play_x(van, sut, p_gen); return _play_x(van, sut, p_gen);
} }
case c3__zpcb: u3x_cell(u3t(gen), &p_gen, &q_gen);
case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen);
{ {
u3_noun ret; u3_noun ret;
@ -456,16 +438,8 @@
u3t_drop(); u3t_drop();
return ret; return ret;
} }
case c3__zpcn:
_play_used();
{
u3_noun pet = u3j_hook(u3k(van), "seed");
u3_noun ret = u3k(u3h(pet));
u3z(pet); case c3__spit: u3x_cell(u3t(gen), &p_gen, &q_gen);
return ret;
}
case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used(); _play_used();
{ {
u3_noun zur = _play_x(van, sut, p_gen); u3_noun zur = _play_x(van, sut, p_gen);
@ -477,8 +451,9 @@
return ret; return ret;
} }
case c3__zpfs:
case c3__zpzp: case c3__lost:
case c3__fail:
_play_used(); _play_used();
{ {
return c3__void; return c3__void;

View File

@ -15,23 +15,18 @@
if ( c3n == u3du(sut) ) switch ( sut ) { if ( c3n == u3du(sut) ) switch ( sut ) {
default: return u3k(sut); default: return u3k(sut);
case c3__noun: case c3__noun: {
return u3nt(c3__fork, return u3kf_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul),
u3nc(c3__atom, u3_blip), u3nt(c3__cell, c3__noun, c3__noun),
u3nt(c3__cell, c3__noun, c3__noun)); u3_nul));
}
} }
else switch ( u3h(sut) ) { else switch ( u3h(sut) ) {
default: { default: {
u3m_p("head", u3h(sut));
return u3m_error("repo-flat"); return u3m_error("repo-flat");
} }
case c3__bull: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail);
} else {
return u3k(q_sut);
}
}
case c3__core: { case c3__core: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut) ) { if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut) ) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
@ -39,13 +34,6 @@
return u3nt(c3__cell, c3__noun, u3k(p_sut)); return u3nt(c3__cell, c3__noun, u3k(p_sut));
} }
} }
case c3__cube: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail);
} else {
return u3k(q_sut);
}
}
case c3__face: { case c3__face: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
@ -54,8 +42,16 @@
} }
} }
case c3__hold: { case c3__hold: {
p_sut = u3t(sut); if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3qfu_rest(van, sut, p_sut); return u3m_bail(c3__fail);
} else {
u3_noun old = u3nc(u3nc(u3k(p_sut), u3k(q_sut)), u3_nul);
u3_noun ret;
ret = u3qfu_rest(van, sut, old);
u3z(old);
return ret;
}
} }
} }
} }

View File

@ -26,26 +26,10 @@
u3_noun gar) u3_noun gar)
{ {
u3_noun gun = u3qdi_gas(u3_nul, gar); u3_noun gun = u3qdi_gas(u3_nul, gar);
u3_noun nog = u3qdi_tap(gun, u3_nul); u3_noun yed = u3qdi_tap(gun, u3_nul);
u3z(gun); u3z(gun);
return nog; return yed;
}
static u3_noun
_rest_in_fork(u3_noun nog,
u3_noun fub)
{
if ( c3n == u3du(nog) ) {
return fub;
} else {
u3_noun buf = _rest_in_fork(u3t(nog),
u3qf_fork(u3h(nog),
fub));
u3z(fub);
return buf;
}
} }
static u3_noun static u3_noun
@ -53,11 +37,11 @@
u3_noun leg) u3_noun leg)
{ {
u3_noun gar = _rest_in_list(van, leg); u3_noun gar = _rest_in_list(van, leg);
u3_noun nog = _rest_in_stil(van, gar); u3_noun yed = _rest_in_stil(van, gar);
u3_noun fub = _rest_in_fork(nog, c3__void); u3_noun fub = u3qf_fork(yed);
u3z(gar); u3z(gar);
u3z(nog); u3z(yed);
return fub; return fub;
} }
@ -116,7 +100,7 @@
u3_noun sut, u3_noun sut,
u3_noun leg) u3_noun leg)
{ {
c3_m fun_m = c3__rest; c3_m fun_m = c3__rest + !!u3r_at(u3qfu_van_vet, van);
u3_noun pro = u3z_find_2(fun_m, sut, leg); u3_noun pro = u3z_find_2(fun_m, sut, leg);
if ( u3_none != pro ) { if ( u3_none != pro ) {

View File

@ -1,290 +0,0 @@
/* j/6/seek.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_seek_flat(u3_noun wob)
{
if ( u3_nul == wob ) {
return u3_nul;
} else {
u3_noun i_wob = u3h(wob);
u3_noun t_wob = u3t(wob);
return u3nc(u3nc(u3k(u3h(i_wob)),
u3nt(c3__ash, u3_nul, 1)),
_seek_flat(t_wob));
}
}
#if 0
static u3_noun
_seek_silk_yew(
u3_noun van,
u3_noun syx,
u3_noun qq_tor)
{
if ( u3_nul == qq_tor ) {
return u3_nul;
}
else {
u3_noun iqq_tor = u3h(qq_tor);
u3_noun qiqq_tor = u3t(iqq_tor);
u3_noun yon = _seek_silk_yew(van, syx, u3t(qq_tor));
if ( c3__yew != u3h(qiqq_tor) ) {
return yon;
} else {
u3_noun nuy = u3qf_look(syx, u3t(qiqq_tor));
if ( u3_nul == nuy ) {
return u3m_error("silk");
}
else {
yon = u3nc(u3k(u3t(nuy)), yon);
u3z(nuy);
return yon;
}
}
}
}
static u3_noun
_seek_silk_yaw(u3_noun
u3_noun hey)
{
u3_atom axe = 0;
while ( u3_nul != hey ) {
if ( axe == 0 ) {
axe = u3h(u3h(hey));
} else if ( axe != u3h(u3h(hey)) ) {
return u3m_error("silk");
}
hey = u3t(hey);
}
}
static u3_noun
_seek_silk_fum(u3_noun
u3_noun hey,
u3_noun qq_tor)
{
if ( u3_nul == qq_tor ) {
return u3_nul;
}
c3_assert(u3_nul != hey);
return u3nc
(u3nc(u3k(u3h(u3h(qq_tor))),
u3k(u3t(u3h(hey)))),
_seek_silk_fum(u3t(hey), u3t(qq_tor)));
}
static u3_noun
_seek_silk(
u3_noun van,
u3_noun syx,
u3_noun tor)
{
u3_noun p_tor, q_tor, pq_tor, qq_tor;
u3_noun hey, ret;
u3r_cell(tor, &p_tor, &q_tor);
if ( c3y == u3h(q_tor) ) {
return u3_nul;
}
u3r_cell(u3t(q_tor), &pq_tor, &qq_tor);
hey = _seek_silk_yew(van, syx, qq_tor);
if ( u3_nul == hey ) {
return u3_nul;
}
if ( u3kb_lent(u3k(hey)) !=
u3kb_lent(u3k(qq_tor)) )
{
return u3m_error("silk");
}
ret = u3nq
(u3_nul,
c3n,
u3qc_peg(pq_tor, _seek_silk_yaw(hey)),
_seek_silk_fum(hey, qq_tor));
u3z(hey);
return ret;
}
#endif
u3_noun
_cqfu_seek(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun hyp)
{
if ( u3_nul == hyp ) {
return u3nt
(1, c3y, u3k(sut));
}
else if ( c3n == u3du(hyp) ) {
return u3m_bail(c3__fail);
}
else {
u3_noun i_hyp = u3h(hyp);
u3_noun t_hyp = u3t(hyp);
u3_noun zar;
u3_noun p_zar, q_zar;
u3_noun yip, syp, ret;
if ( c3y == u3du(i_hyp) ) {
yip = u3k(i_hyp);
} else {
yip = u3nt(c3n, 0, u3k(i_hyp));
}
zar = _cqfu_seek(van, sut, way, t_hyp);
u3r_cell(zar, &p_zar, &q_zar);
#if 0
if ( c3y == u3h(yip) ) {
sic = u3_nul;
} else {
// sic = _seek_silk(van, u3h(u3t(yip)), zar);
sic = u3_nul;
}
if ( u3_nul != sic ) {
u3z(yip);
u3z(zar);
return u3t(sic);
}
#endif
if ( c3y == u3h(q_zar) ) {
syp = u3k(u3t(q_zar));
} else {
u3_noun pq_zar, qq_zar;
u3_noun wip;
u3r_cell(u3t(q_zar), &pq_zar, &qq_zar);
wip = _seek_flat(qq_zar);
syp = u3qfu_fire(van, sut, wip);
u3z(wip);
}
if ( c3n == u3h(yip) ) {
u3_noun p_yip, q_yip, hud;
if ( c3n == u3r_cell(u3t(yip), &p_yip, &q_yip) ) {
return u3m_bail(c3__fail);
}
hud = u3qfu_fink(van, syp, p_yip, way, q_yip);
{
u3_noun p_hud, q_hud;
u3r_cell(hud, &p_hud, &q_hud);
ret = u3nc(u3qc_peg(p_zar, p_hud),
u3k(q_hud));
u3z(hud);
}
}
else {
u3_noun p_yip = u3t(yip);
if ( c3n == u3ud(p_yip) ) {
return u3m_bail(c3__fail);
}
else {
ret = u3nt(u3qc_peg(p_zar, p_yip),
c3y,
u3qfu_peek(van, syp, way, p_yip));
}
}
u3z(yip);
u3z(syp);
u3z(zar);
return ret;
}
}
/* boilerplate
*/
u3_noun
u3wfu_seek(u3_noun cor)
{
u3_noun sut, way, hyp, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &way,
u3x_sam_3, &hyp,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_seek(van, sut, way, hyp);
}
}
u3_noun
u3qfu_seek(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun hyp)
{
c3_m fun_m = c3__seek;
u3_noun pro = u3z_find_3(fun_m, sut, way, hyp);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqfu_seek(van, sut, way, hyp);
return u3z_save_3(fun_m, sut, way, hyp, pro);
}
}
u3_noun
u3qfu_seep(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun hyp)
{
u3_noun zar = u3qfu_seek(van, sut, way, hyp);
u3_noun p_zar = u3h(zar);
u3_noun q_zar = u3t(zar);
if ( c3y != u3h(q_zar) ) {
return u3m_bail(c3__exit);
}
else {
u3_noun ret = u3nc(u3k(p_zar), u3k(u3t(q_zar)));
u3z(zar);
return ret;
}
}
u3_noun
u3wfu_seep(u3_noun cor)
{
u3_noun sut, way, hyp, van;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &way,
u3x_sam_3, &hyp,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return u3qfu_seep(van, sut, way, hyp);
}
}

View File

@ -1,31 +0,0 @@
/* j/6/sift.c
**
*/
#include "all.h"
/* boilerplate
*/
u3_noun
u3wfu_sift(u3_noun cor)
{
u3_noun sut, ref, van;
if ( (c3n == u3r_mean(cor, u3x_sam, &ref,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return u3qfu_sift(van, sut, ref);
}
}
u3_noun
u3qfu_sift(u3_noun van,
u3_noun sut,
u3_noun ref)
{
return u3k(ref);
}

View File

@ -1,57 +0,0 @@
/* j/6/swab.c
**
*/
#include "all.h"
/* internals
*/
/* functions
*/
u3_noun
_cqfu_snub(u3_noun van,
u3_noun sut,
u3_noun har)
{
if ( c3n == u3du(har) ) {
return u3_nul;
} else {
u3_noun i_har = u3h(har);
u3_noun t_har = u3t(har);
u3_noun pi_har = u3h(i_har);
u3_noun qi_har = u3t(i_har);
u3_noun peh = u3qb_flop(pi_har);
u3_noun ret = u3nc(u3nc(peh, u3k(qi_har)),
_cqfu_snub(van, sut, t_har));
return ret;
}
}
/* boilerplate
*/
u3_noun
u3wfu_snub(u3_noun cor)
{
u3_noun van, sut, har;
if ( (c3n == u3r_mean(cor, u3x_sam, &har,
u3x_con, &van,
0)) ||
(u3_none == (sut = u3r_at(u3x_sam, van))) )
{
return u3m_bail(c3__fail);
} else {
return _cqfu_snub(van, sut, har);
}
}
u3_noun
u3qfu_snub(u3_noun van,
u3_noun sut,
u3_noun har)
{
return _cqfu_snub(van, sut, har);
}

View File

@ -3,11 +3,10 @@
*/ */
#include "all.h" #include "all.h"
u3_noun
u3_noun
u3qfu_tack(u3_noun van, u3qfu_tack(u3_noun van,
u3_noun sut, u3_noun sut,
u3_noun peh, u3_noun hyp,
u3_noun mur) u3_noun mur)
{ {
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
@ -15,8 +14,8 @@
return u3n_kick_on(u3i_molt(gat, return u3n_kick_on(u3i_molt(gat,
u3x_sam_2, u3x_sam_2,
u3k(peh), u3k(hyp),
u3x_sam_3, u3x_sam_3,
u3k(mur), u3k(mur),
0)); 0));
} }

View File

@ -1,4 +1,4 @@
/* j/6/tock.c /* j/6/toss.c
** **
*/ */
#include "all.h" #include "all.h"
@ -7,7 +7,7 @@
/* internals /* internals
*/ */
static u3_noun static u3_noun
_tock_in(u3_noun van, _toss_in(u3_noun van,
u3_noun sut, u3_noun sut,
u3_noun peh, u3_noun peh,
u3_noun mur, u3_noun mur,
@ -24,7 +24,7 @@
u3_noun geq = u3qfu_tack(van, pi_men, peh, mur); u3_noun geq = u3qfu_tack(van, pi_men, peh, mur);
u3_noun p_geq = u3h(geq); u3_noun p_geq = u3h(geq);
u3_noun q_geq = u3t(geq); u3_noun q_geq = u3t(geq);
u3_noun mox = _tock_in(van, sut, peh, mur, t_men); u3_noun mox = _toss_in(van, sut, peh, mur, t_men);
u3_noun p_mox = u3h(mox); u3_noun p_mox = u3h(mox);
u3_noun q_mox = u3t(mox); u3_noun q_mox = u3t(mox);
u3_noun ret; u3_noun ret;
@ -46,13 +46,13 @@
/* functions /* functions
*/ */
u3_noun u3_noun
_cqfu_tock(u3_noun van, _cqfu_toss(u3_noun van,
u3_noun sut, u3_noun sut,
u3_noun peh, u3_noun peh,
u3_noun mur, u3_noun mur,
u3_noun men) u3_noun men)
{ {
u3_noun wib = _tock_in(van, sut, peh, mur, men); u3_noun wib = _toss_in(van, sut, peh, mur, men);
u3_noun p_wib = u3h(wib); u3_noun p_wib = u3h(wib);
u3_noun q_wib = u3t(wib); u3_noun q_wib = u3t(wib);
@ -69,7 +69,7 @@
/* boilerplate /* boilerplate
*/ */
u3_noun u3_noun
u3wfu_tock(u3_noun cor) u3wfu_toss(u3_noun cor)
{ {
u3_noun van, sut, peh, mur, men; u3_noun van, sut, peh, mur, men;
@ -82,16 +82,16 @@
{ {
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} else { } else {
return _cqfu_tock(van, sut, peh, mur, men); return _cqfu_toss(van, sut, peh, mur, men);
} }
} }
u3_noun u3_noun
u3qfu_tock(u3_noun van, u3qfu_toss(u3_noun van,
u3_noun sut, u3_noun sut,
u3_noun peh, u3_noun peh,
u3_noun mur, u3_noun mur,
u3_noun men) u3_noun men)
{ {
return _cqfu_tock(van, sut, peh, mur, men); return _cqfu_toss(van, sut, peh, mur, men);
} }

View File

@ -3,6 +3,19 @@
*/ */
#include "all.h" #include "all.h"
static u3_noun _cqfu_wrap(u3_noun, u3_noun, u3_noun);
static u3_noun
_wrap_fork(u3_noun van, u3_noun p_sut, u3_noun yoz)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_cqfu_wrap(van, u3h(p_sut), yoz),
_wrap_fork(van, u3t(p_sut), yoz));
}
}
static u3_noun static u3_noun
_cqfu_wrap(u3_noun van, _cqfu_wrap(u3_noun van,
@ -35,10 +48,13 @@
u3k(rq_sut))); u3k(rq_sut)));
} }
} }
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut); case c3__fork: p_sut = u3t(sut);
{ {
return u3qf_fork(_cqfu_wrap(van, p_sut, yoz), u3_noun yed = u3qdi_tap(p_sut, u3_nul);
_cqfu_wrap(van, q_sut, yoz)); u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz));
u3z(yed);
return ret;
} }
case c3__hold: case c3__hold:
{ {

View File

@ -331,35 +331,26 @@ static u3j_harm _mood__hoon_shay_a[] = {{".2", u3we_shay}, {}};
static u3j_harm _mood__hoon_shas_a[] = {{".2", u3we_shas}, {}}; static u3j_harm _mood__hoon_shas_a[] = {{".2", u3we_shas}, {}};
static u3j_harm _mood__hoon_shal_a[] = {{".2", u3we_shal}, {}}; static u3j_harm _mood__hoon_shal_a[] = {{".2", u3we_shal}, {}};
static u3j_harm _mood__hoon_bull_a[] = {{".2", u3wf_bull}, {}};
static u3j_harm _mood__hoon_cell_a[] = {{".2", u3wf_cell}, {}}; static u3j_harm _mood__hoon_cell_a[] = {{".2", u3wf_cell}, {}};
static u3j_harm _mood__hoon_comb_a[] = {{".2", u3wf_comb}, {}}; static u3j_harm _mood__hoon_comb_a[] = {{".2", u3wf_comb}, {}};
static u3j_harm _mood__hoon_cons_a[] = {{".2", u3wf_cons}, {}}; static u3j_harm _mood__hoon_cons_a[] = {{".2", u3wf_cons}, {}};
static u3j_harm _mood__hoon_core_a[] = {{".2", u3wf_core}, {}}; static u3j_harm _mood__hoon_core_a[] = {{".2", u3wf_core}, {}};
static u3j_harm _mood__hoon_cube_a[] = {{".2", u3wf_cube}, {}};
static u3j_harm _mood__hoon_face_a[] = {{".2", u3wf_face}, {}}; static u3j_harm _mood__hoon_face_a[] = {{".2", u3wf_face}, {}};
static u3j_harm _mood__hoon_fitz_a[] = {{".2", u3wf_fitz}, {}}; static u3j_harm _mood__hoon_fitz_a[] = {{".2", u3wf_fitz}, {}};
static u3j_harm _mood__hoon_flan_a[] = {{".2", u3wf_flan}, {}}; static u3j_harm _mood__hoon_flan_a[] = {{".2", u3wf_flan}, {}};
static u3j_harm _mood__hoon_flay_a[] = {{".2", u3wf_flay}, {}};
static u3j_harm _mood__hoon_flip_a[] = {{".2", u3wf_flip}, {}}; static u3j_harm _mood__hoon_flip_a[] = {{".2", u3wf_flip}, {}};
static u3j_harm _mood__hoon_flor_a[] = {{".2", u3wf_flor}, {}}; static u3j_harm _mood__hoon_flor_a[] = {{".2", u3wf_flor}, {}};
static u3j_harm _mood__hoon_fork_a[] = {{".2", u3wf_fork}, {}}; static u3j_harm _mood__hoon_fork_a[] = {{".2", u3wf_fork}, {}};
static u3j_harm _mood__hoon_hike_a[] = {{".2", u3wf_hike}, {}}; static u3j_harm _mood__hoon_hike_a[] = {{".2", u3wf_hike}, {}};
static u3j_harm _mood__hoon_look_a[] = {{".2", u3wf_look}, {}}; static u3j_harm _mood__hoon_look_a[] = {{".2", u3wf_look}, {}};
static u3j_harm _mood__hoon__ut_busk_a[] = {{".2", u3wfu_busk}, {}}; static u3j_harm _mood__hoon__ut_burn_a[] = {{".2", u3wfu_burn}, {}};
static u3j_harm _mood__hoon__ut_bust_a[] = {{".2", u3wfu_bust}, {}};
static u3j_harm _mood__hoon__ut_conk_a[] = {{".2", u3wfu_conk}, {}}; static u3j_harm _mood__hoon__ut_conk_a[] = {{".2", u3wfu_conk}, {}};
static u3j_harm _mood__hoon__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; static u3j_harm _mood__hoon__ut_crop_a[] = {{".2", u3wfu_crop}, {}};
static u3j_harm _mood__hoon__ut_cull_a[] = {{".2", u3wfu_cull}, {}}; // static u3j_harm _mood__hoon__ut_fire_a[] = {{".2", u3wfu_fire}, {}};
static u3j_harm _mood__hoon__ut_find_a[] = {{".2", u3wfu_find}, {}}; static u3j_harm _mood__hoon__ut_fond_a[] = {{".2", u3wfu_fond}, {}};
static u3j_harm _mood__hoon__ut_fino_a[] = {{".2", u3wfu_fino}, {}};
static u3j_harm _mood__hoon__ut_fink_a[] = {{".2", u3wfu_fink}, {}};
static u3j_harm _mood__hoon__ut_fire_a[] = {{".2", u3wfu_fire}, {}};
static u3j_harm _mood__hoon__ut_firm_a[] = {{".2", u3wfu_firm}, {}};
static u3j_harm _mood__hoon__ut_fish_a[] = {{".2", u3wfu_fish}, {}}; static u3j_harm _mood__hoon__ut_fish_a[] = {{".2", u3wfu_fish}, {}};
static u3j_harm _mood__hoon__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}}; static u3j_harm _mood__hoon__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}};
static u3j_harm _mood__hoon__ut_heal_a[] = {{".2", u3wfu_heal}, {}};
static u3j_harm _mood__hoon__ut_mint_a[] = {{".2", u3wfu_mint}, {}}; static u3j_harm _mood__hoon__ut_mint_a[] = {{".2", u3wfu_mint}, {}};
static u3j_harm _mood__hoon__ut_mull_a[] = {{".2", u3wfu_mull}, {}}; static u3j_harm _mood__hoon__ut_mull_a[] = {{".2", u3wfu_mull}, {}};
static u3j_harm _mood__hoon__ut_nest_a[] = {{".2", u3wfu_nest}, {}}; static u3j_harm _mood__hoon__ut_nest_a[] = {{".2", u3wfu_nest}, {}};
@ -367,27 +358,18 @@ static u3j_harm _mood__hoon__ut_park_a[] = {{".2", u3wfu_park}, {}};
static u3j_harm _mood__hoon__ut_peek_a[] = {{".2", u3wfu_peek}, {}}; static u3j_harm _mood__hoon__ut_peek_a[] = {{".2", u3wfu_peek}, {}};
static u3j_harm _mood__hoon__ut_play_a[] = {{".2", u3wfu_play}, {}}; static u3j_harm _mood__hoon__ut_play_a[] = {{".2", u3wfu_play}, {}};
static u3j_harm _mood__hoon__ut_rest_a[] = {{".2", u3wfu_rest}, {}}; static u3j_harm _mood__hoon__ut_rest_a[] = {{".2", u3wfu_rest}, {}};
static u3j_harm _mood__hoon__ut_seek_a[] = {{".2", u3wfu_seek}, {}}; static u3j_harm _mood__hoon__ut_toss_a[] = {{".2", u3wfu_toss}, {}};
static u3j_harm _mood__hoon__ut_seep_a[] = {{".2", u3wfu_seep}, {}};
static u3j_harm _mood__hoon__ut_snub_a[] = {{".2", u3wfu_snub}, {}};
static u3j_harm _mood__hoon__ut_tock_a[] = {{".2", u3wfu_tock}, {}};
static u3j_harm _mood__hoon__ut_wrap_a[] = {{".2", u3wfu_wrap}, {}}; static u3j_harm _mood__hoon__ut_wrap_a[] = {{".2", u3wfu_wrap}, {}};
static u3j_core _mood__hoon__ut_d[] = static u3j_core _mood__hoon__ut_d[] =
{ {
{ "busk", _mood__hoon__ut_busk_a }, { "burn", _mood__hoon__ut_burn_a },
{ "bust", _mood__hoon__ut_bust_a },
{ "conk", _mood__hoon__ut_conk_a }, { "conk", _mood__hoon__ut_conk_a },
{ "crop", _mood__hoon__ut_crop_a }, { "crop", _mood__hoon__ut_crop_a },
{ "cull", _mood__hoon__ut_cull_a }, { "fond", _mood__hoon__ut_fond_a },
{ "find", _mood__hoon__ut_find_a }, // { "fire", _mood__hoon__ut_fire_a },
{ "fino", _mood__hoon__ut_fino_a },
{ "fink", _mood__hoon__ut_fink_a },
{ "fire", _mood__hoon__ut_fire_a },
{ "firm", _mood__hoon__ut_firm_a },
{ "fish", _mood__hoon__ut_fish_a }, { "fish", _mood__hoon__ut_fish_a },
{ "fuse", _mood__hoon__ut_fuse_a }, { "fuse", _mood__hoon__ut_fuse_a },
{ "heal", _mood__hoon__ut_heal_a },
{ "mint", _mood__hoon__ut_mint_a }, { "mint", _mood__hoon__ut_mint_a },
{ "mull", _mood__hoon__ut_mull_a }, { "mull", _mood__hoon__ut_mull_a },
{ "nest", _mood__hoon__ut_nest_a }, { "nest", _mood__hoon__ut_nest_a },
@ -395,10 +377,7 @@ static u3j_core _mood__hoon__ut_d[] =
{ "peek", _mood__hoon__ut_peek_a }, { "peek", _mood__hoon__ut_peek_a },
{ "play", _mood__hoon__ut_play_a }, { "play", _mood__hoon__ut_play_a },
{ "rest", _mood__hoon__ut_rest_a }, { "rest", _mood__hoon__ut_rest_a },
{ "seek", _mood__hoon__ut_seek_a }, { "toss", _mood__hoon__ut_toss_a },
{ "seep", _mood__hoon__ut_seep_a },
{ "snub", _mood__hoon__ut_snub_a },
{ "tock", _mood__hoon__ut_tock_a },
{ "wrap", _mood__hoon__ut_wrap_a }, { "wrap", _mood__hoon__ut_wrap_a },
{} {}
}; };
@ -408,6 +387,7 @@ static u3j_harm _mood__hoon__ut_a[] =
{} {}
}; };
#if 0
static u3j_harm _mood__hoon__ap_a[] = static u3j_harm _mood__hoon__ap_a[] =
{ // {"hack", u3wfp_open}, { // {"hack", u3wfp_open},
// {"late", u3wfp_open}, // {"late", u3wfp_open},
@ -415,8 +395,6 @@ static u3j_harm _mood__hoon__ap_a[] =
{"rake", u3wfp_rake}, {"rake", u3wfp_rake},
{} {}
}; };
#if 0
static u3j_harm _mood__hoon__al_a[] = static u3j_harm _mood__hoon__al_a[] =
{ {"bunt", u3wfl_bunt}, { {"bunt", u3wfl_bunt},
{"whip", u3wfl_whip}, {"whip", u3wfl_whip},
@ -546,23 +524,20 @@ static u3j_core _mood__hoon_d[] =
{ "shas", _mood__hoon_shas_a }, { "shas", _mood__hoon_shas_a },
{ "shal", _mood__hoon_shal_a }, { "shal", _mood__hoon_shal_a },
{ "bull", _mood__hoon_bull_a },
{ "cell", _mood__hoon_cell_a }, { "cell", _mood__hoon_cell_a },
{ "comb", _mood__hoon_comb_a }, { "comb", _mood__hoon_comb_a },
{ "cons", _mood__hoon_cons_a }, { "cons", _mood__hoon_cons_a },
{ "core", _mood__hoon_core_a }, { "core", _mood__hoon_core_a },
{ "cube", _mood__hoon_cube_a },
{ "face", _mood__hoon_face_a }, { "face", _mood__hoon_face_a },
{ "fitz", _mood__hoon_fitz_a }, { "fitz", _mood__hoon_fitz_a },
{ "flan", _mood__hoon_flan_a }, { "flan", _mood__hoon_flan_a },
{ "flay", _mood__hoon_flay_a },
{ "flip", _mood__hoon_flip_a }, { "flip", _mood__hoon_flip_a },
{ "flor", _mood__hoon_flor_a }, { "flor", _mood__hoon_flor_a },
{ "fork", _mood__hoon_fork_a }, { "fork", _mood__hoon_fork_a },
{ "hike", _mood__hoon_hike_a }, { "hike", _mood__hoon_hike_a },
{ "look", _mood__hoon_look_a }, { "look", _mood__hoon_look_a },
{ "ap", _mood__hoon__ap_a }, // { "ap", _mood__hoon__ap_a },
// { "al", _mood__hoon__al_a }, // { "al", _mood__hoon__al_a },
{ "ut", _mood__hoon__ut_a, _mood__hoon__ut_d }, { "ut", _mood__hoon__ut_a, _mood__hoon__ut_d },
{ "arvo", 0, _arvo_d }, { "arvo", 0, _arvo_d },
@ -575,13 +550,13 @@ static u3j_core _mood_d[] =
{} {}
}; };
static u3j_core _k163_d[] = static u3j_core _k151_d[] =
{ { "mood", 0, _mood_d }, { { "mood", 0, _mood_d },
{} {}
}; };
static u3j_core _d[] = { static u3j_core _d[] = {
{ "k163", 0, _k163_d}, { "k151", 0, _k151_d},
{} {}
}; };

View File

@ -357,6 +357,11 @@ _cj_soft(u3_noun cor, u3_noun axe)
return u3n_nock_on(cor, u3k(arm)); return u3n_nock_on(cor, u3k(arm));
} }
void
find_error(u3_noun cor,
u3_noun old,
u3_noun new);
/* _cj_kick_z(): try to kick by jet. If no kick, produce u3_none. /* _cj_kick_z(): try to kick by jet. If no kick, produce u3_none.
** **
** `cor` is RETAINED iff there is no kick, TRANSFERRED if one. ** `cor` is RETAINED iff there is no kick, TRANSFERRED if one.
@ -402,16 +407,19 @@ _cj_kick_z(u3_noun cor, u3j_core* cop_u, u3j_harm* ham_u, u3_atom axe)
(!strcmp(".2", ham_u->fcs_c)) ? "$" : ham_u->fcs_c, (!strcmp(".2", ham_u->fcs_c)) ? "$" : ham_u->fcs_c,
u3r_mug(ame), u3r_mug(ame),
u3r_mug(pro)); u3r_mug(pro));
ham_u->liv = c3n;
c3_assert(0); c3_assert(0);
return u3m_bail(c3__fail); return u3m_bail(c3__fail);
} }
else { else {
#if 1 #if 0
fprintf(stderr, "test: %s %s\r\n", fprintf(stderr, "test: %s %s\r\n",
cop_u->cos_c, cop_u->cos_c,
(!strcmp(".2", ham_u->fcs_c)) ? "$" : ham_u->fcs_c); (!strcmp(".2", ham_u->fcs_c)) ? "$" : ham_u->fcs_c);
#endif #endif
u3z(ame);
return pro;
} }
} }
return u3_none; return u3_none;

View File

@ -9,6 +9,8 @@
#include "all.h" #include "all.h"
#undef NO_OVERFLOW
/* (u3_noun)setjmp(u3R->esc.buf): setjmp within road. /* (u3_noun)setjmp(u3R->esc.buf): setjmp within road.
*/ */
#if 0 #if 0
@ -73,7 +75,9 @@ static sigjmp_buf u3_Signal;
#ifndef SIGSTKSZ #ifndef SIGSTKSZ
# define SIGSTKSZ 16384 # define SIGSTKSZ 16384
#endif #endif
#ifndef NO_OVERFLOW
static uint8_t Sigstk[SIGSTKSZ]; static uint8_t Sigstk[SIGSTKSZ];
#endif
void u3_unix_ef_hold(void); // suspend system signal regime void u3_unix_ef_hold(void); // suspend system signal regime
void u3_unix_ef_move(void); // restore system signal regime void u3_unix_ef_move(void); // restore system signal regime
@ -131,11 +135,13 @@ _cm_signal_handle(c3_l sig_l)
} }
} }
#ifndef NO_OVERFLOW
static void static void
_cm_signal_handle_over(int emergency, stackoverflow_context_t scp) _cm_signal_handle_over(int emergency, stackoverflow_context_t scp)
{ {
_cm_signal_handle(c3__over); _cm_signal_handle(c3__over);
} }
#endif
static void static void
_cm_signal_handle_term(int x) _cm_signal_handle_term(int x)
@ -294,7 +300,9 @@ _cm_signal_deep(c3_w sec_w)
{ {
u3_unix_ef_hold(); u3_unix_ef_hold();
#ifndef NO_OVERFLOW
stackoverflow_install_handler(_cm_signal_handle_over, Sigstk, SIGSTKSZ); stackoverflow_install_handler(_cm_signal_handle_over, Sigstk, SIGSTKSZ);
#endif
signal(SIGINT, _cm_signal_handle_intr); signal(SIGINT, _cm_signal_handle_intr);
signal(SIGTERM, _cm_signal_handle_term); signal(SIGTERM, _cm_signal_handle_term);
@ -461,7 +469,7 @@ u3m_mark(void)
c3_w tot_w = 0; c3_w tot_w = 0;
tot_w += u3h_mark(u3R->jed.har_p); tot_w += u3h_mark(u3R->jed.har_p);
tot_w += u3a_mark_noun(u3R->jed.das); tot_w += u3a_mark_noun(u3R->jed.das);
tot_w += u3a_mark_noun(u3R->ski.flu); tot_w += u3a_mark_noun(u3R->ski.gul);
tot_w += u3a_mark_noun(u3R->bug.tax); tot_w += u3a_mark_noun(u3R->bug.tax);
tot_w += u3a_mark_noun(u3R->bug.mer); tot_w += u3a_mark_noun(u3R->bug.mer);
tot_w += u3a_mark_noun(u3R->pro.don); tot_w += u3a_mark_noun(u3R->pro.don);
@ -604,10 +612,20 @@ u3m_bail(u3_noun how)
} }
switch ( how ) { switch ( how ) {
#if 0 #if 1
case c3__fail: case c3__fail:
case c3__meme: case c3__meme:
#endif #endif
case c3__exit: {
static c3_w xuc_w = 0;
{
// fprintf(stderr, "exit %d\r\n", xuc_w);
// if ( 49 == xuc_w ) { abort(); }
xuc_w++;
break;
}
}
case c3__foul: case c3__foul:
case c3__oops: case c3__oops:
abort(); abort();
@ -950,7 +968,7 @@ u3m_soft_nock(u3_noun bus, u3_noun fol)
/* u3m_soft_run(): descend into virtualization context. /* u3m_soft_run(): descend into virtualization context.
*/ */
u3_noun u3_noun
u3m_soft_run(u3_noun fly, u3m_soft_run(u3_noun gul,
u3_funq fun_f, u3_funq fun_f,
u3_noun aga, u3_noun aga,
u3_noun agb) u3_noun agb)
@ -964,7 +982,7 @@ u3m_soft_run(u3_noun fly,
/* Configure the new road. /* Configure the new road.
*/ */
{ {
u3R->ski.flu = u3nc(fly, u3to(u3_road, u3R->par_p)->ski.flu); u3R->ski.gul = u3nc(gul, u3to(u3_road, u3R->par_p)->ski.gul);
u3R->pro.don = u3to(u3_road, u3R->par_p)->pro.don; u3R->pro.don = u3to(u3_road, u3R->par_p)->pro.don;
u3R->bug.tax = 0; u3R->bug.tax = 0;
} }
@ -1026,7 +1044,7 @@ u3m_soft_run(u3_noun fly,
/* Release the arguments. /* Release the arguments.
*/ */
{ {
u3z(fly); u3z(gul);
u3z(aga); u3z(aga);
u3z(agb); u3z(agb);
} }
@ -1039,15 +1057,15 @@ u3m_soft_run(u3_noun fly,
/* u3m_soft_esc(): namespace lookup. Produces direct result. /* u3m_soft_esc(): namespace lookup. Produces direct result.
*/ */
u3_noun u3_noun
u3m_soft_esc(u3_noun sam) u3m_soft_esc(u3_noun ref, u3_noun sam)
{ {
u3_noun why, fly, pro; u3_noun why, gul, pro;
/* Assert preconditions. /* Assert preconditions.
*/ */
{ {
c3_assert(0 != u3R->ski.flu); c3_assert(0 != u3R->ski.gul);
fly = u3h(u3R->ski.flu); gul = u3h(u3R->ski.gul);
} }
/* Record the cap, and leap. /* Record the cap, and leap.
@ -1057,7 +1075,7 @@ u3m_soft_esc(u3_noun sam)
/* Configure the new road. /* Configure the new road.
*/ */
{ {
u3R->ski.flu = u3t(u3to(u3_road, u3R->par_p)->ski.flu); u3R->ski.gul = u3t(u3to(u3_road, u3R->par_p)->ski.gul);
u3R->pro.don = u3to(u3_road, u3R->par_p)->pro.don; u3R->pro.don = u3to(u3_road, u3R->par_p)->pro.don;
u3R->bug.tax = 0; u3R->bug.tax = 0;
} }
@ -1065,7 +1083,7 @@ u3m_soft_esc(u3_noun sam)
/* Trap for exceptions. /* Trap for exceptions.
*/ */
if ( 0 == (why = (u3_noun)_setjmp(u3R->esc.buf)) ) { if ( 0 == (why = (u3_noun)_setjmp(u3R->esc.buf)) ) {
pro = u3n_slam_on(fly, sam); pro = u3n_slam_on(gul, u3nc(ref, sam));
/* Fall back to the old road, leaving temporary memory intact. /* Fall back to the old road, leaving temporary memory intact.
*/ */
@ -1080,8 +1098,10 @@ u3m_soft_esc(u3_noun sam)
u3m_bail(u3nc(4, u3m_love(why))); u3m_bail(u3nc(4, u3m_love(why)));
} }
/* Release the sample. /* Release the sample. Note that we used it above, but in a junior
** road, so its refcount is intact.
*/ */
u3z(ref);
u3z(sam); u3z(sam);
/* Return the product. /* Return the product.

View File

@ -5,6 +5,24 @@
static u3_noun _n_nock_on(u3_noun bus, u3_noun fol); static u3_noun _n_nock_on(u3_noun bus, u3_noun fol);
/* u3_term_io_hija(): hijack console for cooked print.
*/
FILE*
u3_term_io_hija(void);
/* u3_term_io_loja(): release console from cooked print.
*/
void
u3_term_io_loja(int x);
/* uL, uH: wrap hijack/lojack around fprintf.
**
** uL(fprintf(uH, ...));
*/
# define uH u3_term_io_hija()
# define uL(x) u3_term_io_loja(x)
/* _n_hint(): process hint. /* _n_hint(): process hint.
*/ */
static u3_noun static u3_noun
@ -31,12 +49,22 @@ _n_hint(u3_noun zep,
u3t_push(tac); u3t_push(tac);
#if 0 #if 0
if ( c3__spot == zep ) { {
printf("spot %d/%d : %d/%d\r\n", static int low_i;
u3h(u3h(u3t(hod))),
u3t(u3h(u3t(hod))), if ( !low_i ) {
u3h(u3t(u3t(hod))), low_i = 1;
u3t(u3t(u3t(hod)))); if ( 0 == (u3R->pro.nox_d % 65536ULL) ) {
if ( c3__spot == zep ) {
uL(fprintf(uH, "spot %d/%d : %d/%d\r\n",
u3h(u3h(u3t(hod))),
u3t(u3h(u3t(hod))),
u3h(u3t(u3t(hod))),
u3t(u3t(u3t(hod)))));
}
}
low_i = 0;
}
} }
#endif #endif
pro = _n_nock_on(bus, nex); pro = _n_nock_on(bus, nex);
@ -317,22 +345,30 @@ _n_nock_on(u3_noun bus, u3_noun fol)
} }
case 11: { case 11: {
u3_noun gof = _n_nock_on(bus, u3k(gal)); u3_noun ref = _n_nock_on(u3k(bus), u3k(u3h(gal)));
u3_noun gof = _n_nock_on(bus, u3k(u3t(gal)));
u3_noun val; u3_noun val;
u3t_off(noc_o); u3t_off(noc_o);
val = u3m_soft_esc(u3k(gof)); val = u3m_soft_esc(ref, u3k(gof));
u3t_on(noc_o); u3t_on(noc_o);
if ( !_(u3du(val)) ) { if ( !_(u3du(val)) ) {
u3m_bail(u3nt(1, gof, 0)); u3m_bail(u3nt(1, gof, 0));
} }
if ( !_(u3du(u3t(val))) ) {
//
// replace with proper error stack push
//
u3m_p("lost", gof);
return u3m_bail(c3__exit);
}
else { else {
u3_noun pro; u3_noun pro;
u3z(gof); u3z(gof);
u3z(fol); u3z(fol);
pro = u3k(u3t(val)); pro = u3k(u3t(u3t(val)));
u3z(val); u3z(val);
return pro; return pro;
@ -386,40 +422,20 @@ u3n_slam_on(u3_noun gat, u3_noun sam)
return u3n_kick_on(cor); return u3n_kick_on(cor);
} }
/* u3n_nock_un(): produce .*(bus fol), as ++toon. /* u3n_nock_et(): produce .*(bus fol), as ++toon, in namespace.
*/ */
u3_noun u3_noun
u3n_nock_un(u3_noun bus, u3_noun fol) u3n_nock_et(u3_noun gul, u3_noun bus, u3_noun fol)
{ {
u3_noun fly = u3nt(u3nt(11, 0, 6), 0, 0); // |=(a=* .^(a)) return u3m_soft_run(gul, u3n_nock_on, bus, fol);
return u3n_nock_in(fly, bus, fol);
} }
/* u3n_slam_un(): produce (gat sam), as ++toon. /* u3n_slam_et(): produce (gat sam), as ++toon, in namespace.
*/ */
u3_noun u3_noun
u3n_slam_un(u3_noun gat, u3_noun sam) u3n_slam_et(u3_noun gul, u3_noun gat, u3_noun sam)
{ {
u3_noun fly = u3nt(u3nt(11, 0, 6), 0, 0); // |=(a=* .^(a)) return u3m_soft_run(gul, u3n_slam_on, gat, sam);
return u3n_slam_in(fly, gat, sam);
}
/* u3n_nock_in(): produce .*(bus fol), as ++toon, in namespace.
*/
u3_noun
u3n_nock_in(u3_noun fly, u3_noun bus, u3_noun fol)
{
return u3m_soft_run(fly, u3n_nock_on, bus, fol);
}
/* u3n_slam_in(): produce (gat sam), as ++toon, in namespace.
*/
u3_noun
u3n_slam_in(u3_noun fly, u3_noun gat, u3_noun sam)
{
return u3m_soft_run(fly, u3n_slam_on, gat, sam);
} }
/* u3n_nock_an(): as slam_in(), but with empty fly. /* u3n_nock_an(): as slam_in(), but with empty fly.
@ -427,7 +443,7 @@ u3n_slam_in(u3_noun fly, u3_noun gat, u3_noun sam)
u3_noun u3_noun
u3n_nock_an(u3_noun bus, u3_noun fol) u3n_nock_an(u3_noun bus, u3_noun fol)
{ {
u3_noun fly = u3nt(u3nc(1, 0), 0, 0); // |=(a=* ~) u3_noun gul = u3nt(u3nt(1, 0, 0), 0, 0); // |=(a/{* *} ~)
return u3n_nock_in(fly, bus, fol); return u3n_nock_et(gul, bus, fol);
} }

View File

@ -1856,7 +1856,7 @@ _raft_grab(u3_noun ova)
{ {
if ( u3_nul != u3A->sac ) { if ( u3_nul != u3A->sac ) {
c3_w usr_w = 0, ova_w = 0, sac_w = 0, utv_w = 0, utm_w = 0, wep_w = 0, c3_w usr_w = 0, ova_w = 0, sac_w = 0, utv_w = 0, utm_w = 0, wep_w = 0,
har_w = 0, das_w = 0, flu_w = 0, tax_w = 0, mer_w = 0, don_w = 0, har_w = 0, das_w = 0, gul_w = 0, tax_w = 0, mer_w = 0, don_w = 0,
day_w = 0, car_w = 0; day_w = 0, car_w = 0;
c3_assert( u3R == &(u3H->rod_u) ); c3_assert( u3R == &(u3H->rod_u) );
@ -1886,9 +1886,9 @@ _raft_grab(u3_noun ova)
fprintf(stderr, " cold jet state: "); fprintf(stderr, " cold jet state: ");
_raft_print_memory(das_w); _raft_print_memory(das_w);
flu_w = u3a_mark_noun(u3R->ski.flu); gul_w = u3a_mark_noun(u3R->ski.gul);
fprintf(stderr, " namespace: "); fprintf(stderr, " namespace: ");
_raft_print_memory(flu_w); _raft_print_memory(gul_w);
tax_w = u3a_mark_noun(u3R->bug.tax); tax_w = u3a_mark_noun(u3R->bug.tax);
fprintf(stderr, " trace stack list: "); fprintf(stderr, " trace stack list: ");
@ -1910,7 +1910,7 @@ _raft_grab(u3_noun ova)
fprintf(stderr, " memoization: "); fprintf(stderr, " memoization: ");
_raft_print_memory(car_w); _raft_print_memory(car_w);
utm_w = har_w + das_w + flu_w + tax_w + mer_w + don_w + day_w + car_w; utm_w = har_w + das_w + gul_w + tax_w + mer_w + don_w + day_w + car_w;
fprintf(stderr, "total road stuff: "); fprintf(stderr, "total road stuff: ");
_raft_print_memory(utm_w); _raft_print_memory(utm_w);