Why don't all three of these return their unevaluated argument like the first one does? Is there a way to make the last two work like the first? Inside the function, e is still unevaluated, this seems to happen when the result is returned.
names default to here(1);
ns = New Namespace("n");
foo = function({e}, Name Expr(e) );
ns:bar = function({e}, Name Expr(e) );
show( foo( expr( notavar ) ) ); // expected returns notavar, unevalauted
show( here:foo( expr( notavarhere ) ) ); // unexpected tries to evaluate notavarhere
show( ns:bar( expr( notavarns ) ) ); // unexpected tries to evaluate notavarns
Inside the function e is unevaluated, as expected:
ns:bart = function( {e}, Show( Name Expr(e) ) );
ns:bart( expr( notavar ) ); // expected, unevaluated
There is an uninspiring workaround by copying the function to the current default namespace, although it doesn't solve nested function calls.
localbar = name expr( ns:bar );
show( localbar( expr( notavar ) ) ); // expected, unevaluated