urbit/j/6/type.c

47 lines
806 B
C
Raw Normal View History

2013-09-29 00:21:18 +04:00
/* j/6/type.c
**
** This file is in the public domain.
*/
/* new template for type switching
*/
{
2014-09-06 00:13:24 +04:00
u3_noun p_sut, q_sut, r_sut;
2013-09-29 00:21:18 +04:00
2014-09-06 00:13:24 +04:00
if ( u3_no == u3du(sut) ) switch ( sut ) {
default: return u3_cm_bail(c3__fail);
2013-09-29 00:21:18 +04:00
case c3__noun:
2013-09-29 00:21:18 +04:00
{
}
case c3__void:
{
}
}
2014-09-06 00:13:24 +04:00
else switch ( u3h(sut) ) {
default: return u3_cm_bail(c3__fail);
2013-09-29 00:21:18 +04:00
2014-09-06 00:13:24 +04:00
case c3__atom: p_sut = u3t(sut);
2013-09-29 00:21:18 +04:00
{
}
2014-09-06 00:13:24 +04:00
case c3__cell: u3_cx_cell(u3t(sut), &p_sut, &q_sut);
2013-09-29 00:21:18 +04:00
{
}
2014-09-06 00:13:24 +04:00
case c3__core: u3_cx_cell(u3t(sut), &p_sut, &q_sut);
2013-09-29 00:21:18 +04:00
{
}
2014-09-06 00:13:24 +04:00
case c3__cube: u3_cx_cell(u3t(sut), &p_sut, &q_sut);
2013-09-29 00:21:18 +04:00
{
}
2014-09-06 00:13:24 +04:00
case c3__face: u3_cx_cell(u3t(sut), &p_sut, &q_sut);
2013-09-29 00:21:18 +04:00
{
}
2014-09-06 00:13:24 +04:00
case c3__fork: u3_cx_cell(u3t(sut), &p_sut, &q_sut);
2013-09-29 00:21:18 +04:00
{
}
2014-09-06 00:13:24 +04:00
case c3__hold: p_sut = u3t(sut);
2013-09-29 00:21:18 +04:00
{
}
}
}