car() public method

public car ( )
Exemplo n.º 1
0
 public function apply(Lisphp_Scope $scope, Lisphp_List $arguments)
 {
     $vars = $arguments->car();
     $scope = new Lisphp_Scope($scope);
     foreach ($vars as $var) {
         list($var, $value) = $var;
         $scope->let($var, $value->evaluate($scope->superscope));
     }
     foreach ($arguments->cdr() as $form) {
         $retval = $form->evaluate($scope);
     }
     return $retval;
 }
Exemplo n.º 2
0
 function apply(Lisphp_Scope $scope, Lisphp_List $arguments)
 {
     $tmp = new Lisphp_Scope();
     $use = new Lisphp_Runtime_Use();
     $ns = (string) $arguments->car();
     $simpleNames = iterator_to_array($arguments[1]);
     foreach ($simpleNames as $name) {
         $names[] = Lisphp_Symbol::get("{$ns}/{$name}");
     }
     $retval = $use->apply($tmp, new Lisphp_List($names));
     foreach ($simpleNames as $i => $name) {
         $scope->let($name, $retval[$i]);
     }
     return $retval;
 }