Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: adfa7bf660
Fetching contributors…

Cannot retrieve contributors at this time

file 18 lines (17 sloc) 0.571 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php
require_once 'Lisphp/Applicable.php';
require_once 'Lisphp/List.php';
require_once 'Lisphp/Scope.php';

final class Lisphp_Runtime_Setf implements Lisphp_Applicable {
    function apply(Lisphp_Scope $scope, Lisphp_List $arguments) {
        $name = $arguments[0];
        if ($name instanceof Lisphp_Symbol) {
            $retval = $arguments[1]->evaluate($scope);
        } else {
            throw new InvalidArgumentException(
                'first operand of setf! form must be symbol'
            );
        }
        return $scope[$name] = $retval;
    }
}
Something went wrong with that request. Please try again.