Arthur Brandao 6 роки тому
батько
коміт
fdb6b4d1f8
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      src/migl/lisp/LispFactory.java

+ 6 - 1
src/migl/lisp/LispFactory.java

@@ -7,6 +7,8 @@ package migl.lisp;
  *
  */
 public class LispFactory {
+	
+	private static Lisp interpreter;
 
     private LispFactory() {
         // do nothing
@@ -18,6 +20,9 @@ public class LispFactory {
      * @return a new lisp interpreter.
      */
     public static Lisp makeIntepreter() {
-        return new LispImpl();
+    	if(interpreter == null) {
+    		interpreter = new LispImpl();
+    	}
+        return interpreter;
     }
 }