mirror of
https://github.com/urbit/shrub.git
synced 2024-12-16 06:51:14 +03:00
26 lines
692 B
C
26 lines
692 B
C
/* j/5/mule.c
|
|
**
|
|
** This file is in the public domain.
|
|
*/
|
|
#include "all.h"
|
|
#include "../pit.h"
|
|
|
|
u2_weak // produce
|
|
j2_mb(Pt5, mule)(u2_noun cor) // retain
|
|
{
|
|
u2_noun tap;
|
|
|
|
if ( u2_no == u2_cr_mean(cor, u2_cv_sam, &tap, 0) ) {
|
|
return u2_cm_bail(c3__exit);
|
|
}
|
|
else {
|
|
u2_noun hok = u2_cj_hook(u2k(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_cn_slam_on(hok, u2k(tap));;
|
|
}
|
|
}
|