u32
swaack(u32 stack)
{
- u32 list = pop_list(stack);
- CHECK_ERROR
- stack = cons(tail(stack), list);
- CHECK_ERROR
+ u32 list = pop_list(stack); CHECK_ERROR
+ stack = cons(tail(stack), list); CHECK_ERROR
return stack;
}
u32
first(u32 stack)
{
- u32 list = pop_list(stack);
- CHECK_ERROR
+ u32 list = pop_list(stack); CHECK_ERROR
if (!list) {
error = CANNOT_TAKE_FIRST_OF_EMPTY_LIST;
return 0;
}
- stack = cons(head(list), tail(stack));
- CHECK_ERROR
+ stack = cons(head(list), tail(stack)); CHECK_ERROR
return stack;
}
u32
rest(u32 stack)
{
- u32 list = pop_list(stack);
- CHECK_ERROR
+ u32 list = pop_list(stack); CHECK_ERROR
if (!list) {
error = CANNOT_TAKE_REST_OF_EMPTY_LIST;
return 0;
}
- stack = cons(tail(list), tail(stack));
- CHECK_ERROR
+ stack = cons(tail(list), tail(stack)); CHECK_ERROR
return stack;
}
u32
dup(u32 stack)
{
- u32 tos = pop_any(stack);
- CHECK_ERROR
- stack = cons(tos, stack);
- CHECK_ERROR
+ u32 tos = pop_any(stack); CHECK_ERROR
+ stack = cons(tos, stack); CHECK_ERROR
return stack;
}
u32
swap(u32 stack)
{
- u32 tos = pop_any(stack);
- CHECK_ERROR
+ u32 tos = pop_any(stack); CHECK_ERROR
stack = tail(stack);
- u32 second = pop_any(stack);
- CHECK_ERROR
+ u32 second = pop_any(stack); CHECK_ERROR
stack = tail(stack);
- stack = cons(tos, stack);
- CHECK_ERROR
- stack = cons(second, stack);
- CHECK_ERROR
+ stack = cons(tos, stack); CHECK_ERROR
+ stack = cons(second, stack); CHECK_ERROR
return stack;
}
term = head(expression);
expression = tail(expression);
if (TYPE_OF(term) == joySymbol) {
- char *symbol = ht_lookup(VALUE_OF(term));
- CHECK_ERROR
- u64 new_state = joy_eval(symbol, stack, expression);
- CHECK_ERROR
+ char *symbol = ht_lookup(VALUE_OF(term)); CHECK_ERROR
+ u64 new_state = joy_eval(symbol, stack, expression); CHECK_ERROR
stack = new_state >> 32;
expression = new_state & 0xffffffff;
}
- else {
- stack = cons(term, stack);
- CHECK_ERROR
- }
+ else { stack = cons(term, stack); CHECK_ERROR }
}
return stack;
}