scheme as a virtual machine - III

After experimenting with CPSCM, I have to drop it. The final now consists of two implementations: Chicken and Gambit.

For closures, CPSCM relies on the host language. It works well for Scheme, Lisp and JavaScript backends, but no luck for PHP.

function getMyFunc($a){
  return create_function('$b', 'print "a='.$a.', b=$b";');
}
$f1 = getMyFunc(1);
$f1(2);

The code above and a few tricks to emulate lambdas do not work in PHP 4. As I was told on Stackoverflow, "...some changes have been made starting with PHP 5.3, but even there you don't have your expected variable scopes that would allow you to do what you have in your examples."

http://stackoverflow.com/questions/4155254/anonymous-functions-lambdas-closures-in-php-4

Anyway, despite of dropping, I like CPSCM.

18.11.2010, update

The same problem is with Chicken. The final winner is Gambit.

Categories: scheme

Updated: