Use function alias in validation messages

Resolves #9
This commit is contained in:
Mike Cifelli 2017-03-07 10:59:51 -05:00
parent 368f22a02b
commit 5f10396af8
39 changed files with 85 additions and 90 deletions

View File

@ -15,8 +15,8 @@ public class APPLY extends LispFunction {
return lookupFunction("APPLY").call(argumentList); return lookupFunction("APPLY").call(argumentList);
} }
public APPLY() { public APPLY(String name) {
this.argumentValidator = new ArgumentValidator("APPLY"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(2); this.argumentValidator.setExactNumberOfArguments(2);
this.argumentValidator.setTrailingArgumentExpectedType(Cons.class); this.argumentValidator.setTrailingArgumentExpectedType(Cons.class);
} }

View File

@ -53,8 +53,8 @@ public class EVAL extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public EVAL() { public EVAL(String name) {
this.argumentValidator = new ArgumentValidator("EVAL"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
} }

View File

@ -12,8 +12,8 @@ public class EXIT extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private RuntimeEnvironment environment; private RuntimeEnvironment environment;
public EXIT() { public EXIT(String name) {
this.argumentValidator = new ArgumentValidator("EXIT"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMaximumNumberOfArguments(0); this.argumentValidator.setMaximumNumberOfArguments(0);
this.environment = RuntimeEnvironment.getInstance(); this.environment = RuntimeEnvironment.getInstance();
} }

View File

@ -11,8 +11,8 @@ public class FUNCALL extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public FUNCALL() { public FUNCALL(String name) {
this.argumentValidator = new ArgumentValidator("FUNCALL"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
} }

View File

@ -18,16 +18,15 @@ import sexpression.*;
@FunctionNames({ "LOAD" }) @FunctionNames({ "LOAD" })
public class LOAD extends LispFunction { public class LOAD extends LispFunction {
private static Stack<String> pathPrefixes = new Stack<>();
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private RuntimeEnvironment environment; private RuntimeEnvironment environment;
private Stack<String> pathPrefixes;
public LOAD() { public LOAD(String name) {
this.argumentValidator = new ArgumentValidator("LOAD"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(LispString.class); this.argumentValidator.setEveryArgumentExpectedType(LispString.class);
this.environment = RuntimeEnvironment.getInstance(); this.environment = RuntimeEnvironment.getInstance();
this.pathPrefixes = new Stack<>();
} }
public SExpression call(Cons argumentList) { public SExpression call(Cons argumentList) {

View File

@ -10,8 +10,8 @@ public class PRINT extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private RuntimeEnvironment environment; private RuntimeEnvironment environment;
public PRINT() { public PRINT(String name) {
this.argumentValidator = new ArgumentValidator("PRINT"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
this.environment = RuntimeEnvironment.getInstance(); this.environment = RuntimeEnvironment.getInstance();
} }

View File

@ -16,8 +16,8 @@ public class SET extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private ExecutionContext executionContext; private ExecutionContext executionContext;
public SET() { public SET(String name) {
this.argumentValidator = new ArgumentValidator("SET"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(2); this.argumentValidator.setExactNumberOfArguments(2);
this.argumentValidator.setFirstArgumentExpectedType(Symbol.class); this.argumentValidator.setFirstArgumentExpectedType(Symbol.class);
this.executionContext = ExecutionContext.getInstance(); this.executionContext = ExecutionContext.getInstance();

View File

@ -13,8 +13,8 @@ public class SYMBOL_FUNCTION extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public SYMBOL_FUNCTION() { public SYMBOL_FUNCTION(String name) {
this.argumentValidator = new ArgumentValidator("SYMBOL-FUNCTION"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(Symbol.class); this.argumentValidator.setEveryArgumentExpectedType(Symbol.class);
} }

View File

@ -8,8 +8,8 @@ public class CONS extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public CONS() { public CONS(String name) {
this.argumentValidator = new ArgumentValidator("CONS"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(2); this.argumentValidator.setExactNumberOfArguments(2);
} }

View File

@ -8,8 +8,8 @@ public class FIRST extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public FIRST() { public FIRST(String name) {
this.argumentValidator = new ArgumentValidator("FIRST"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(Cons.class); this.argumentValidator.setEveryArgumentExpectedType(Cons.class);
} }

View File

@ -11,7 +11,7 @@ import sexpression.*;
public class LENGTH extends LispFunction { public class LENGTH extends LispFunction {
public static BigInteger getLength(Cons list) { public static BigInteger getLength(Cons list) {
LENGTH lengthFunction = new LENGTH(); LENGTH lengthFunction = new LENGTH("LENGTH");
LispNumber length = lengthFunction.callWithoutArgumentValidation(makeList(list)); LispNumber length = lengthFunction.callWithoutArgumentValidation(makeList(list));
return length.getValue(); return length.getValue();
@ -19,8 +19,8 @@ public class LENGTH extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public LENGTH() { public LENGTH(String name) {
this.argumentValidator = new ArgumentValidator("LENGTH"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(Cons.class); this.argumentValidator.setEveryArgumentExpectedType(Cons.class);
} }

View File

@ -14,8 +14,8 @@ public class LIST extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public LIST() { public LIST(String name) {
this.argumentValidator = new ArgumentValidator("LIST"); this.argumentValidator = new ArgumentValidator(name);
} }
public Cons call(Cons argumentList) { public Cons call(Cons argumentList) {

View File

@ -8,8 +8,8 @@ public class REST extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public REST() { public REST(String name) {
this.argumentValidator = new ArgumentValidator("REST"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(Cons.class); this.argumentValidator.setEveryArgumentExpectedType(Cons.class);
} }

View File

@ -11,8 +11,8 @@ public class DIVIDE extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private MathFunction mathFunction; private MathFunction mathFunction;
public DIVIDE() { public DIVIDE(String name) {
this.argumentValidator = new ArgumentValidator("/"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class); this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class);
this.mathFunction = new MathFunction(this::getReciprocal, this::divide); this.mathFunction = new MathFunction(this::getReciprocal, this::divide);

View File

@ -11,8 +11,8 @@ public class MINUS extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private MathFunction mathFunction; private MathFunction mathFunction;
public MINUS() { public MINUS(String name) {
this.argumentValidator = new ArgumentValidator("-"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class); this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class);
this.mathFunction = new MathFunction(this::additiveInverse, this::subtract); this.mathFunction = new MathFunction(this::additiveInverse, this::subtract);

View File

@ -11,8 +11,8 @@ public class MULTIPLY extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private MathFunction mathFunction; private MathFunction mathFunction;
public MULTIPLY() { public MULTIPLY(String name) {
this.argumentValidator = new ArgumentValidator("*"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class); this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class);
this.mathFunction = new MathFunction(number -> number, this::multiply); this.mathFunction = new MathFunction(number -> number, this::multiply);
} }

View File

@ -11,8 +11,8 @@ public class PLUS extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private MathFunction mathFunction; private MathFunction mathFunction;
public PLUS() { public PLUS(String name) {
this.argumentValidator = new ArgumentValidator("+"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class); this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class);
this.mathFunction = new MathFunction(number -> number, this::add); this.mathFunction = new MathFunction(number -> number, this::add);
} }

View File

@ -11,8 +11,8 @@ public class ATOM extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public ATOM() { public ATOM(String name) {
this.argumentValidator = new ArgumentValidator("ATOM"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
} }

View File

@ -11,8 +11,8 @@ public class EQ extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public EQ() { public EQ(String name) {
this.argumentValidator = new ArgumentValidator("EQ"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(2); this.argumentValidator.setExactNumberOfArguments(2);
} }

View File

@ -15,8 +15,8 @@ public class EQUAL extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public EQUAL() { public EQUAL(String name) {
this.argumentValidator = new ArgumentValidator("EQUAL"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(2); this.argumentValidator.setExactNumberOfArguments(2);
} }

View File

@ -11,8 +11,8 @@ public class LISTP extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public LISTP() { public LISTP(String name) {
this.argumentValidator = new ArgumentValidator("LISTP"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
} }

View File

@ -11,8 +11,8 @@ public class NULL extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public NULL() { public NULL(String name) {
this.argumentValidator = new ArgumentValidator("NULL"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
} }

View File

@ -11,8 +11,8 @@ public class NUMERIC_EQUAL extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public NUMERIC_EQUAL() { public NUMERIC_EQUAL(String name) {
this.argumentValidator = new ArgumentValidator("="); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class); this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class);
} }

View File

@ -11,8 +11,8 @@ public class NUMERIC_GREATER extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public NUMERIC_GREATER() { public NUMERIC_GREATER(String name) {
this.argumentValidator = new ArgumentValidator(">"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class); this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class);
} }

View File

@ -11,8 +11,8 @@ public class NUMERIC_LESS extends LispFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public NUMERIC_LESS() { public NUMERIC_LESS(String name) {
this.argumentValidator = new ArgumentValidator("<"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class); this.argumentValidator.setEveryArgumentExpectedType(LispNumber.class);
} }

View File

@ -11,8 +11,8 @@ public class AND extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public AND() { public AND(String name) {
this.argumentValidator = new ArgumentValidator("AND"); this.argumentValidator = new ArgumentValidator(name);
} }
public SExpression call(Cons argumentList) { public SExpression call(Cons argumentList) {

View File

@ -13,8 +13,8 @@ public class CASE extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public CASE() { public CASE(String name) {
this.argumentValidator = new ArgumentValidator("CASE"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.argumentValidator.setTrailingArgumentExpectedType(Cons.class); this.argumentValidator.setTrailingArgumentExpectedType(Cons.class);
this.argumentValidator.setTrailingArgumentExcludedType(Nil.class); this.argumentValidator.setTrailingArgumentExcludedType(Nil.class);

View File

@ -11,8 +11,8 @@ public class COND extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public COND() { public COND(String name) {
this.argumentValidator = new ArgumentValidator("COND"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setEveryArgumentExpectedType(Cons.class); this.argumentValidator.setEveryArgumentExpectedType(Cons.class);
this.argumentValidator.setEveryArgumentExcludedType(Nil.class); this.argumentValidator.setEveryArgumentExcludedType(Nil.class);
} }

View File

@ -6,8 +6,8 @@ import sexpression.*;
@FunctionNames({ "DEFINE-MACRO" }) @FunctionNames({ "DEFINE-MACRO" })
public class DEFINE_MACRO extends Define { public class DEFINE_MACRO extends Define {
public DEFINE_MACRO() { public DEFINE_MACRO(String name) {
super("DEFINE-MACRO"); super(name);
} }
@Override @Override

View File

@ -6,8 +6,8 @@ import sexpression.*;
@FunctionNames({ "DEFUN" }) @FunctionNames({ "DEFUN" })
public class DEFUN extends Define { public class DEFUN extends Define {
public DEFUN() { public DEFUN(String name) {
super("DEFUN"); super(name);
} }
@Override @Override

View File

@ -10,8 +10,8 @@ public class IF extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public IF() { public IF(String name) {
this.argumentValidator = new ArgumentValidator("IF"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(2); this.argumentValidator.setMinimumNumberOfArguments(2);
this.argumentValidator.setMaximumNumberOfArguments(3); this.argumentValidator.setMaximumNumberOfArguments(3);
} }

View File

@ -25,7 +25,7 @@ public class LAMBDA extends LispSpecialFunction {
lambdaValidator.setEveryArgumentExpectedType(Cons.class); lambdaValidator.setEveryArgumentExpectedType(Cons.class);
lambdaValidator.validate(makeList(rest)); lambdaValidator.validate(makeList(rest));
LambdaExpression lambda = new LAMBDA().call((Cons) rest); LambdaExpression lambda = new LAMBDA("LAMBDA").call((Cons) rest);
return lambda.getFunction(); return lambda.getFunction();
} }
@ -33,12 +33,12 @@ public class LAMBDA extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
private ArgumentValidator lambdaListValidator; private ArgumentValidator lambdaListValidator;
public LAMBDA() { public LAMBDA(String name) {
this.argumentValidator = new ArgumentValidator("LAMBDA"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setFirstArgumentExpectedType(Cons.class); this.argumentValidator.setFirstArgumentExpectedType(Cons.class);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.lambdaListValidator = new ArgumentValidator("LAMBDA|lambda-list|"); this.lambdaListValidator = new ArgumentValidator(name + "|lambda-list|");
this.lambdaListValidator.setEveryArgumentExpectedType(Symbol.class); this.lambdaListValidator.setEveryArgumentExpectedType(Symbol.class);
} }

View File

@ -15,15 +15,15 @@ public class LET extends LispSpecialFunction {
private ArgumentValidator pairValidator; private ArgumentValidator pairValidator;
private ExecutionContext executionContext; private ExecutionContext executionContext;
public LET() { public LET(String name) {
this.argumentValidator = new ArgumentValidator("LET"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setMinimumNumberOfArguments(1); this.argumentValidator.setMinimumNumberOfArguments(1);
this.argumentValidator.setFirstArgumentExpectedType(Cons.class); this.argumentValidator.setFirstArgumentExpectedType(Cons.class);
this.variableDefinitionListValidator = new ArgumentValidator("LET|pair-list|"); this.variableDefinitionListValidator = new ArgumentValidator(name + "|pair-list|");
this.variableDefinitionListValidator.setEveryArgumentExpectedType(Cons.class); this.variableDefinitionListValidator.setEveryArgumentExpectedType(Cons.class);
this.pairValidator = new ArgumentValidator("LET|pair|"); this.pairValidator = new ArgumentValidator(name + "|pair|");
this.pairValidator.setMinimumNumberOfArguments(1); this.pairValidator.setMinimumNumberOfArguments(1);
this.pairValidator.setMaximumNumberOfArguments(2); this.pairValidator.setMaximumNumberOfArguments(2);
this.pairValidator.setFirstArgumentExpectedType(Symbol.class); this.pairValidator.setFirstArgumentExpectedType(Symbol.class);

View File

@ -10,8 +10,8 @@ public class OR extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public OR() { public OR(String name) {
this.argumentValidator = new ArgumentValidator("OR"); this.argumentValidator = new ArgumentValidator(name);
} }
public SExpression call(Cons argumentList) { public SExpression call(Cons argumentList) {

View File

@ -11,8 +11,8 @@ public class PROGN extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public PROGN() { public PROGN(String name) {
this.argumentValidator = new ArgumentValidator("PROGN"); this.argumentValidator = new ArgumentValidator(name);
} }
public SExpression call(Cons argumentList) { public SExpression call(Cons argumentList) {

View File

@ -8,8 +8,8 @@ public class QUOTE extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public QUOTE() { public QUOTE(String name) {
this.argumentValidator = new ArgumentValidator("QUOTE"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(1); this.argumentValidator.setExactNumberOfArguments(1);
} }

View File

@ -12,8 +12,8 @@ public class SETF extends LispSpecialFunction {
private ArgumentValidator argumentValidator; private ArgumentValidator argumentValidator;
public SETF() { public SETF(String name) {
this.argumentValidator = new ArgumentValidator("SETF"); this.argumentValidator = new ArgumentValidator(name);
this.argumentValidator.setExactNumberOfArguments(2); this.argumentValidator.setExactNumberOfArguments(2);
this.argumentValidator.setFirstArgumentExpectedType(Symbol.class); this.argumentValidator.setFirstArgumentExpectedType(Symbol.class);
} }

View File

@ -110,17 +110,15 @@ public class FunctionTable {
} }
private void addAllFunctionNamesToTable(Class<? extends LispFunction> function, String[] names) { private void addAllFunctionNamesToTable(Class<? extends LispFunction> function, String[] names) {
LispFunction instance = createInstance(function);
for (String name : names) for (String name : names)
table.put(name, instance); table.put(name, createInstance(function, name));
} }
private LispFunction createInstance(Class<? extends LispFunction> function) { private LispFunction createInstance(Class<? extends LispFunction> function, String name) {
LispFunction instance = null; LispFunction instance = null;
try { try {
instance = function.getConstructor().newInstance(); instance = function.getConstructor(String.class).newInstance(name);
} catch (Exception e) { } catch (Exception e) {
throw new LispFunctionInstantiationException(function.getName()); throw new LispFunctionInstantiationException(function.getName());
} }

View File

@ -19,6 +19,8 @@ public class FunctionTableTester {
@FunctionNames({ "GOOD" }) @FunctionNames({ "GOOD" })
public static class GoodFunction extends LispFunction { public static class GoodFunction extends LispFunction {
public GoodFunction(String name) {}
@Override @Override
public SExpression call(Cons argList) { public SExpression call(Cons argList) {
return NIL; return NIL;
@ -28,10 +30,6 @@ public class FunctionTableTester {
@FunctionNames({ "BAD" }) @FunctionNames({ "BAD" })
public static class BadFunction extends LispFunction { public static class BadFunction extends LispFunction {
public BadFunction() {
throw new IllegalArgumentException("bad function");
}
@Override @Override
public SExpression call(Cons argList) { public SExpression call(Cons argList) {
return NIL; return NIL;