Almost truthy...
This commit is contained in:
parent
6159165acd
commit
b70229d727
|
|
@ -582,9 +582,27 @@ clear(JoyListPtr stack, __attribute__((unused)) JoyListPtr expression)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void div_joyfunc(JoyListPtr stack, JoyListPtr expression) {stack = expression;}
|
void
|
||||||
void mod(JoyListPtr stack, JoyListPtr expression) {stack = expression;}
|
truthy(JoyListPtr stack, JoyListPtr expression)
|
||||||
void truthy(JoyListPtr stack, JoyListPtr expression) {stack = expression;}
|
{
|
||||||
|
*stack = EMPTY_LIST;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
JoyListPtr s = stack;
|
||||||
|
JoyList node = pop_any(stack);
|
||||||
|
switch (node->head->kind) {
|
||||||
|
case joyTrue:
|
||||||
|
stack = s;
|
||||||
|
case joyFalse:
|
||||||
|
stack = s;
|
||||||
|
case joyInt:
|
||||||
|
push_thing(
|
||||||
|
if (node->head->value.i);
|
||||||
|
default:
|
||||||
|
|
||||||
|
stack = expression;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,31 @@
|
||||||
|
|
||||||
|
So how do we want to handle definitions? Read a defs.txt file at
|
||||||
|
compile time? Build defs.c from defs.txt?
|
||||||
|
|
||||||
|
void
|
||||||
|
defname(JoyListPtr stack, JoyListPtr expression)
|
||||||
|
{
|
||||||
|
def_node = some C initializer?
|
||||||
|
def_node = text_to_expression("dup mul");
|
||||||
|
push_quote(def_node, expression);
|
||||||
|
}
|
||||||
|
|
||||||
|
...?
|
||||||
|
|
||||||
|
I think the easiest thing to do at the mo' would be to hardcode the defs
|
||||||
|
as an array of strings and then read them and convert at start time?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*mpz_t pi;*/
|
/*mpz_t pi;*/
|
||||||
/*char *text = (char *)TEXT;*/
|
/*char *text = (char *)TEXT;*/
|
||||||
/*mpz_init_set_str(pi, "3141592653589793238462643383279502884", 10);*/
|
/*mpz_init_set_str(pi, "3141592653589793238462643383279502884", 10);*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue