Explorar el Código

Block_eval() executes its body in a new environment

master
Ian Piumarta hace 1 año
padre
commit
bc3aae1dcb
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. +4
    -2
      minproto.leg

+ 4
- 2
minproto.leg Ver fichero

@ -1,6 +1,6 @@
# minproto.leg -- minimal prototype langauge for semantic experiments
#
# last edited: 2024-05-07 14:39:10 by piumarta on zora-1034.local
# last edited: 2024-05-07 23:23:22 by piumarta on m1mbp
%{
;
@ -1578,7 +1578,9 @@ oop Block_eval(oop exp, oop env)
oop *indexed = _get(body, Object,indexed);
int size = _get(body, Object,isize);
oop result = nil;
for (int i = 0; i < size; ++i) result = eval(indexed[i], env);
oop env2 = new(pObject);
_setDelegate(env2, env);
for (int i = 0; i < size; ++i) result = eval(indexed[i], env2);
return result;
}

Cargando…
Cancelar
Guardar