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

17 lines
387 B
Java
Raw Normal View History

2019-12-14 02:42:25 +00:00
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");
2019-12-14 02:42:25 +00:00
}
}
2019-12-14 02:42:25 +00:00
@Override
public Object eval(final BaseScope scope) {
return this.node.rest().first();
}
2019-12-14 02:42:25 +00:00
}