Add a simple GENSYM function

Resolves #18
This commit is contained in:
Mike Cifelli 2017-03-10 13:14:16 -05:00
parent e78e18df98
commit 16b9a4dd30
1 changed files with 2 additions and 0 deletions

View File

@ -9,10 +9,12 @@ import sexpression.*;
public class GENSYM extends LispFunction { public class GENSYM extends LispFunction {
public static final String GENSYM_PREFIX = "#G"; public static final String GENSYM_PREFIX = "#G";
private static BigInteger counter = BigInteger.ZERO; private static BigInteger counter = BigInteger.ZERO;
private static Symbol generateSymbol() { private static Symbol generateSymbol() {
incrementCounter(); incrementCounter();
return new Symbol(GENSYM_PREFIX + counter); return new Symbol(GENSYM_PREFIX + counter);
} }