Function calling

This commit is contained in:
2025-12-06 11:50:42 +11:00
parent 571d3bcc34
commit 9553934db5
6 changed files with 100 additions and 39 deletions

View File

@@ -44,6 +44,12 @@ GroundValue createListGroundValue(List in) {
return gv;
}
GroundValue createFunctionGroundValue(GroundFunction* in) {
GroundValue gv;
gv.data.fnVal = in;
gv.type = FUNCTION;
return gv;
}
GroundValue copyGroundValue(const GroundValue* gv) {
GroundValue newGv;
@@ -69,6 +75,7 @@ GroundValue copyGroundValue(const GroundValue* gv) {
newGv.data.listVal = newList;
break;
}
case FUNCTION: newGv.data.fnVal = gv->data.fnVal; break;
case CUSTOM:
newGv.data.customVal = gv->data.customVal; // Shallow copy for custom
break;