Trying Barton's suggestion for lexical variables works somewhat.
I have no idea what it breaks; it's certainly not a real solution,
but it's kind of interesting.
1) copy (defun make-declares .. from transl.lisp to a file and
edit the second to last line to read
(unless $no_default_special
(if specs (pushnew `(special . ,specs) dl :test #'eq)))
2) load the new definition.
then put this in tfun.mac :
-----------
g(x) := x+y;
f(x) := block([y:3], g(x)+y);
----------
(%i1) load("./make-declares.lisp")$
(%i2) no_default_special : false$
(%i3) compile_file("./tfun.mac");
(%i4) f(z);
(%o4) z + 6
(%i5) no_default_special : true;
(%o5) true
(%i6) compile_file("./tfun.mac");
(%i7) f(z);
(%o7) z + y + 3
This only seems to work when the code is compiled.
--- John Lapeyre