Skip to content

Commit

Permalink
jet mule.
Browse files Browse the repository at this point in the history
  • Loading branch information
vvisigoth committed May 18, 2014
1 parent 32b60ed commit 66a56c9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ J164_5_OFILES=\
gen164/5/jam.o \
gen164/5/mat.o \
gen164/5/mink.o \
gen164/5/mule.o \
gen164/5/parse.o \
gen164/5/repg.o \
gen164/5/rexp.o \
Expand Down
33 changes: 33 additions & 0 deletions gen164/5/mule.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* j/5/mink.c
**
** This file is in the public domain.
*/
#include "all.h"
#include "../pit.h"

u2_weak // produce
j2_mb(Pt5, mule)(u2_wire wir_r,
u2_noun cor) // retain
{
u2_noun tap;

if ( u2_no == u2_mean(cor, u2_cv_sam, &tap, 0) ) {
return u2_bl_bail(wir_r, c3__exit);
}
else {
u2_noun hok = u2_bn_hook(wir_r, cor, "mute");
/* this takes advantage of the fact that mute's result, at the typeless
* C/Nock level, is identical to what a typed mule would produce,
* without running the formula twice.
*/
return u2_bn_mong(wir_r, hok, u2k(tap));;
}
}

/* structures
*/
u2_ho_jet
j2_mbj(Pt5, mule)[] = {
{ ".2", c3__lite, j2_mb(Pt5, mule), Tier5, u2_none, u2_none },
{ }
};
2 changes: 2 additions & 0 deletions gen164/watt.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
extern u2_ho_jet j2_mbj(Pt5, cue)[];
extern u2_ho_jet j2_mbj(Pt5, mat)[];
extern u2_ho_jet j2_mbj(Pt5, mink)[];
extern u2_ho_jet j2_mbj(Pt5, mule)[];
extern u2_ho_jet j2_mbj(Pt5, jam)[];
extern u2_ho_jet j2_mbj(Pt5, loss)[];
extern u2_ho_jet j2_mbj(Pt5, lore)[];
Expand Down Expand Up @@ -231,6 +232,7 @@
{ j2_sb(Pt5, mask), 0, j2_mbd(Pt5, mask), 0, u2_none },
{ j2_sb(Pt5, mat), j2_mbj(Pt5, mat), 0, 0, u2_none },
{ j2_sb(Pt5, mink), j2_mbj(Pt5, mink), 0, 0, u2_none },
{ j2_sb(Pt5, mule), j2_mbj(Pt5, mule), 0, 0, u2_none },
{ j2_sb(Pt5, og), 0, j2_mbd(Pt5, og), 0, u2_none },
{ j2_sb(Pt5, pfix), j2_mbj(Pt5, pfix), 0, 0, u2_none },
{ j2_sb(Pt5, plug), j2_mbj(Pt5, plug), 0, 0, u2_none },
Expand Down
2 changes: 2 additions & 0 deletions urb/zod/arvo/hoon.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
%al al
%ap ap
%ut ut
%mute mute
%seed seed
%show show
==
Expand Down Expand Up @@ -3727,6 +3728,7 @@
(mink [[-.gat [sam +>.gat]] -.gat] sky)
::
++ mule :: typed virtual
~/ %mule
|* taq=_|.(_*)
=+ mud=(mute taq)
?- -.mud
Expand Down

0 comments on commit 66a56c9

Please sign in to comment.