Given a php-builtin defined like this:
(define *scheme-var* 10)
(defbuiltin (some-builtin (opt-arg1 *scheme-var*))
opt-arg1))
The following PHP script:
<?php echo some-builtin()."\n"; ?>
produces the _string_:
*scheme-var*
because the default value gets quoted before being evaluated and then when it eventually gets evaluated, it evaluates to the symbol *scheme-var* and not the value of *scheme-var*.
ADDITIONAL INFORMATION:
changing compiler/generate.scm line 947 from:
,(let ((default (optional-formal-param-default-value p)))
to:
,(let ((default (eval (optional-formal-param-default-value p))))
fixes the problem and doesn't break anything else.
Also, changing line 1552 (or so) in php-runtime.scm from:
((quote ?FOO) FOO)
to:
((quote ?FOO) (eval FOO))
did not fix the problem.