package function.builtin.special;

import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;

@FunctionNames({ "QUOTE" })
public class QUOTE extends LispSpecialFunction {

    private ArgumentValidator argumentValidator;

    public QUOTE(String name) {
        this.argumentValidator = new ArgumentValidator(name);
        this.argumentValidator.setExactNumberOfArguments(1);
    }

    @Override
    public SExpression call(Cons argumentList) {
        argumentValidator.validate(argumentList);

        return argumentList.getFirst();
    }

}
