package function.builtin;

import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import table.ExecutionContext;

@FunctionNames({ "SYMBOLS" })
public class SYMBOLS extends LispFunction {

    private ArgumentValidator argumentValidator;
    private ExecutionContext executionContext;

    public SYMBOLS(String name) {
        this.argumentValidator = new ArgumentValidator(name);
        this.argumentValidator.setExactNumberOfArguments(0);
        this.executionContext = ExecutionContext.getInstance();
    }

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

        return executionContext.toList();
    }

}
