@Override public Value eval(Env environment) { if (environment.hasValue(this)) { return environment.getValue(this); } return typeOf(environment).getDefaultValue(); }
@Override public List<Message> checkType(Env environment) { List<Message> errors = new ArrayList<Message>(); if (!environment.typeOf(this).isDefined()) { errors.add(new Error("Ident " + name + " does not exist in current environment!")); } return errors; }
@Override public Type typeOf(Env environment) { return environment.typeOf(this); }