urbit/gen164/5/mule.c

26 lines
574 B
C
Raw Normal View History

2014-08-20 10:22:41 +04:00
/* j/5/mule.c
2014-05-19 03:16:01 +04:00
**
** This file is in the public domain.
*/
#include "all.h"
#include "../pit.h"
2014-09-04 01:33:18 +04:00
u2_noun
u2_cwe_mule(u2_noun cor)
2014-05-19 03:16:01 +04:00
{
u2_noun tap;
2014-08-20 10:22:41 +04:00
if ( u2_no == u2_cr_mean(cor, u2_cv_sam, &tap, 0) ) {
return u2_cm_bail(c3__exit);
2014-05-19 03:16:01 +04:00
}
else {
2014-08-21 01:18:34 +04:00
u2_noun hok = u2_cj_hook(u2k(cor), "mute");
2014-08-20 10:22:41 +04:00
2014-05-19 03:16:01 +04:00
/* 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.
*/
2014-08-20 10:22:41 +04:00
return u2_cn_slam_on(hok, u2k(tap));;
2014-05-19 03:16:01 +04:00
}
}