transcendental-lisp/src/function/builtin/FUNCALL.java

23 lines
568 B
Java

package function.builtin;
import function.*;
import sexpression.*;
public class FUNCALL extends LispFunction {
private ArgumentValidator argumentValidator;
public FUNCALL() {
this.argumentValidator = new ArgumentValidator("FUNCALL");
this.argumentValidator.setMinimumNumberOfArguments(1);
}
public SExpression call(Cons argumentList) {
argumentValidator.validate(argumentList);
Cons applyArgs = new Cons(argumentList.getCar(), LIST.makeList(argumentList.getCdr()));
return APPLY.apply(applyArgs);
}
}