Closed francescoagati closed 13 years ago
With an hash that compile many lambda , pharen compile in php a sequence of function nested, giving error of access of function:
this is the pharen code:
(def functions {
})
and this is the code php
Lexical::$scopes['prova'] = array(); $scope_id = Lexical::init_closure("prova", 55); function provalambdafunc9($a, $b, $closure_id){ function provalambdafunc8($a, $b, $closure_id){ function provalambdafunc7($a, $b, $__closure_id){ return $a + $b; }
return $a + $b;
}
$functions = array("fn1" => array("provalambdafunc7", Lexical::get_closure_id("prova", Null)), "fn2" => array("provalambdafunc8", Lexical::get_closure_id("prova", Null)), "fn3" => array("prova__lambdafunc9", Lexical::get_closure_id("prova", Null))); Lexical::bind_lexing("prova", 55, '$functions', $functions);
Should be fixed now though it's still a tricky situation. The whole $tmp variable thing is one of the weak points of Pharen in that it's hard to track what goes where.
tested is ok
With an hash that compile many lambda , pharen compile in php a sequence of function nested, giving error of access of function:
this is the pharen code:
(def functions {
fn1 (lambda (a b) (+ a b))
fn2 (lambda (a b) (+ a b))
fn3 (lambda (a b) (+ a b))
})
and this is the code php
Lexical::$scopes['prova'] = array(); $scope_id = Lexical::init_closure("prova", 55); function provalambdafunc9($a, $b, $closure_id){ function provalambdafunc8($a, $b, $closure_id){ function provalambdafunc7($a, $b, $__closure_id){ return $a + $b; }
}
}
$functions = array("fn1" => array("provalambdafunc7", Lexical::get_closure_id("prova", Null)), "fn2" => array("provalambdafunc8", Lexical::get_closure_id("prova", Null)), "fn3" => array("prova__lambdafunc9", Lexical::get_closure_id("prova", Null))); Lexical::bind_lexing("prova", 55, '$functions', $functions);