From 468e0f6313fb620bd2f7ea469178fe02412ddc31 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Mon, 24 Jan 2022 21:18:01 +0000 Subject: =?UTF-8?q?Implement=20=E2=8D=BA=E2=8D=B5=E2=8D=B6=E2=8D=B9=20as?= =?UTF-8?q?=20get-set=20variables,=20which=20may=20make=20it=20easier=20to?= =?UTF-8?q?=20do=20TCO=20later.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eval.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 60c2e0d..a2d4d43 100644 --- a/eval.c +++ b/eval.c @@ -151,6 +151,7 @@ lookup(Datum var) incref(val->array); /* since the value is now in the var AND in the code */ } val->shy = 0; + traceprint("VAR %S = %S\n", var.symbol->name, ppdatum(*val)); return val; } @@ -225,11 +226,7 @@ nameis(Datum left, Datum right) Datum assign(Datum left, Datum right) { - if(runestrcmp(left.symbol->name, L"⍵") == 0) - throwerror(nil, ESyntax); - else if(runestrcmp(left.symbol->name, L"⍺") == 0 && !left.symbol->undefined) - goto end; - else if(left.symbol->setfn != nil) + if(left.symbol->setfn != nil) left.symbol->setfn(right); else{ if(left.symbol->undefined == 0 && left.symbol->value.tag == ArrayTag) @@ -241,7 +238,6 @@ assign(Datum left, Datum right) incref(right.array); /* for the binding */ } } -end: right.shy = 1; if(right.tag == ArrayTag) incref(right.array); /* for the returned array */ -- cgit v1.2.3