Differences From Artifact [1c0a1caee00496c7]:
- File
polemy/eval.d
- 2010-11-26 06:46:09 - part of checkin [552d43f567] on branch trunk - one-by-one M&E memoizer (user: kinaba) [annotate]
To Artifact [47affa2343c633ca]:
- File
polemy/eval.d
- 2010-11-26 07:14:27 - part of checkin [94f0382499] on branch trunk - changed the semantics of def foo(x @macro) {}, the @macro-layered parameter. - in @macro( foo(e) ), e is run in @macro (this is ok) - in @value( foo(e) ), e is run in (rawmacro)!! - in @rawmacro( foo(e) ), e is run in (rawmacro)!! (user: kinaba) [annotate]
219 219 {
220 220 Table newCtx = new Table(f.definitionContext(), Table.Kind.NotPropagateSet);
221 221 foreach(i,p; f.params())
222 222 if( p.layers.empty )
223 223 newCtx.set(p.name, isMacroLayer(lay)?MacroLayer:lay, eval(args[i], lay, ctx));
224 224 else
225 225 foreach(argLay; p.layers)
226 - newCtx.set(p.name, argLay, eval(args[i], argLay, ctx));
226 + if( lay!=MacroLayer && isMacroLayer(argLay) ) // explicit @macro invokes (rawmacro)
227 + newCtx.set(p.name, argLay, eval(args[i], RawMacroLayer, ctx));
228 + else
229 + newCtx.set(p.name, argLay, eval(args[i], argLay, ctx));
227 230 scope _ = new PushCallStack(pos, callstackmsg);
228 231 return f.invoke(isMacroLayer(lay)?MacroLayer:lay, newCtx, pos);
229 232 }
230 233 throw genex!RuntimeException(pos, text("tried to call non-function: ",_f));
231 234 }
232 235
233 236 Value lift(Value v, Layer lay, Table ctx, LexPosition pos)