Lisphp_Runtime_Function::execute PHP Method

execute() protected method

protected execute ( array $arguments )
$arguments array
    protected function execute(array $arguments)
    {
        $local = new Lisphp_Scope($this->scope);
        foreach ($this->parameters as $i => $name) {
            if (!array_key_exists($i, $arguments)) {
                throw new InvalidArgumentException('too few arguments');
            }
            $local->let($name, $arguments[$i]);
        }
        $local->let('#arguments', new Lisphp_List($arguments));
        foreach ($this->body as $form) {
            $retval = $form->evaluate($local);
        }
        return $retval;
    }