|
@@ -27,6 +27,7 @@ public class LispImpl implements Lisp {
|
|
|
//Définition des opérateurs
|
|
|
operators.put("define", new DefineOperator());
|
|
|
operators.put("set!", new DefineOperator());
|
|
|
+ operators.put("lambda", new DefineOperator());
|
|
|
operators.put("cons", new ConsOperator());
|
|
|
operators.put(">", new ComparatorOperator());
|
|
|
operators.put(">=", new ComparatorOperator());
|
|
@@ -350,11 +351,11 @@ public class LispImpl implements Lisp {
|
|
|
try {
|
|
|
LispElement.valueOf(name).toStr();
|
|
|
} catch (IllegalStateException ex) {
|
|
|
- throw new LispError(name + " is not a valid identifier", ex);
|
|
|
+ throw new LispError(name + LispError.ERR_INVALID, ex);
|
|
|
}
|
|
|
//Verifie que ce n'est pas le nom d'un operateur
|
|
|
if(operators.containsKey(name)) {
|
|
|
- throw new LispError(name + " is not a valid identifier");
|
|
|
+ throw new LispError(name + LispError.ERR_INVALID);
|
|
|
}
|
|
|
}
|
|
|
|