22 lines
511 B
Java
22 lines
511 B
Java
package function.builtin.predicate;
|
|
|
|
import function.*;
|
|
import sexpression.*;
|
|
|
|
public class NULL extends LispFunction {
|
|
|
|
private ArgumentValidator argumentValidator;
|
|
|
|
public NULL() {
|
|
this.argumentValidator = new ArgumentValidator("NULL");
|
|
this.argumentValidator.setExactNumberOfArguments(1);
|
|
}
|
|
|
|
public SExpression call(Cons argumentList) {
|
|
argumentValidator.validate(argumentList);
|
|
|
|
return argumentList.getFirst().nullp() ? Symbol.T : Nil.getInstance();
|
|
}
|
|
|
|
}
|