serene-simple/src/main/java/serene/simple/QuoteSpecialForm.java

17 lines
387 B
Java

package serene.simple;
public class QuoteSpecialForm extends SpecialForm {
public QuoteSpecialForm(ListNode<Node> node) throws SereneException {
super(node);
if (this.node.rest().length != 1) {
throw new SereneException("quote expects only one arguement");
}
}
@Override
public Object eval(final BaseScope scope) {
return this.node.rest().first();
}
}