[snow-cvs] r43 - in trunk: lib src/java/snow src/java/snow/swing src/lisp/snow/showcase

Alessio Stalla astalla at common-lisp.net
Mon Jan 11 21:38:18 UTC 2010


Author: astalla
Date: Mon Jan 11 16:38:17 2010
New Revision: 43

Log:
Updated to latest ABCL (pre-0.18) which changes its streams implementation and some API.
Fixed the showcase which was broken due to ambiguous import of the symbol SELF (exported by both Snow and Cells).


Modified:
   trunk/lib/abcl.jar
   trunk/src/java/snow/DialogPromptStream.java
   trunk/src/java/snow/swing/ConsoleDocument.java
   trunk/src/lisp/snow/showcase/showcase.lisp

Modified: trunk/lib/abcl.jar
==============================================================================
Binary files. No diff available.

Modified: trunk/src/java/snow/DialogPromptStream.java
==============================================================================
--- trunk/src/java/snow/DialogPromptStream.java	(original)
+++ trunk/src/java/snow/DialogPromptStream.java	Mon Jan 11 16:38:17 2010
@@ -5,7 +5,7 @@
 import java.io.StringReader;
 import java.io.StringWriter;
 
-import org.armedbear.lisp.Stream;
+import org.armedbear.lisp.*;
 
 /**
  * A bidirectional stream that captures input from a modal dialog. The dialog reports a label (prompt line)
@@ -18,16 +18,17 @@
  */
 public abstract class DialogPromptStream extends Stream {
 
-	private StringWriter writtenSoFar = new StringWriter();
-	private Reader reader = new Reader() {
-
-		private StringReader stringReader = null;
-		private int inputSize = 0;
-		
-		@Override
-		public void close() throws IOException {
-			closeDialog();
-		}
+    private StringWriter writtenSoFar = new StringWriter();
+    private Reader reader = new Reader() {
+	    
+	    private StringReader stringReader = null;
+	    private int inputSize = 0;
+	    
+
+	    @Override
+	    public void close() throws IOException {
+		closeDialog();
+	    }
 
 		@Override
 		public int read(char[] cbuf, int off, int len) throws IOException {
@@ -52,13 +53,14 @@
 		
 	};
 
-	/**
-	 * Inits this stream. Should be called by subclasses' constructors.
-	 */
-	protected DialogPromptStream() {
-		initAsCharacterOutputStream(writtenSoFar);
-		initAsCharacterInputStream(reader);
-	}
+    /**
+     * Inits this stream. Should be called by subclasses' constructors.
+     */
+    protected DialogPromptStream() {
+	super(Symbol.SYSTEM_STREAM);
+	initAsCharacterOutputStream(writtenSoFar);
+	initAsCharacterInputStream(reader);
+    }
 	
 	/**
 	 * Closes the dialog when this stream is closed, aborting the read operation.

Modified: trunk/src/java/snow/swing/ConsoleDocument.java
==============================================================================
--- trunk/src/java/snow/swing/ConsoleDocument.java	(original)
+++ trunk/src/java/snow/swing/ConsoleDocument.java	Mon Jan 11 16:38:17 2010
@@ -52,14 +52,7 @@
 import javax.swing.text.DefaultStyledDocument;
 import javax.swing.text.JTextComponent;
 
-import org.armedbear.lisp.Function;
-import org.armedbear.lisp.Interpreter;
-import org.armedbear.lisp.LispObject;
-import org.armedbear.lisp.LispThread;
-import org.armedbear.lisp.SpecialBindingsMark;
-import org.armedbear.lisp.Stream;
-import org.armedbear.lisp.Symbol;
-import org.armedbear.lisp.TwoWayStream;
+import org.armedbear.lisp.*;
 
 import static org.armedbear.lisp.Lisp.*;
 
@@ -124,8 +117,8 @@
 	private final Thread replThread;
 	
     public ConsoleDocument(LispObject replFunction) {
-	final LispObject replWrapper = makeReplWrapper(new StreamEx(new BufferedReader(reader)),
-						       new StreamEx(new BufferedWriter(writer)),
+	final LispObject replWrapper = makeReplWrapper(new Stream(Symbol.SYSTEM_STREAM, new BufferedReader(reader)),
+						       new Stream(Symbol.SYSTEM_STREAM, new BufferedWriter(writer)),
 						       replFunction);
 	replThread = new Thread("REPL-thread-" + System.identityHashCode(this)) {
 		public void run() {
@@ -202,18 +195,6 @@
 		return writer;
 	}
 	
-	public static class StreamEx extends Stream {
-		
-	    public StreamEx(Reader r) {
-	    	initAsCharacterInputStream(r);
-        }
-
-        public StreamEx(Writer w) {
-        	initAsCharacterOutputStream(w);
-        }
-		
-	}
-	
 	public void setupTextComponent(final JTextComponent txt) {
 		addDocumentListener(new DocumentListener() {
 

Modified: trunk/src/lisp/snow/showcase/showcase.lisp
==============================================================================
--- trunk/src/lisp/snow/showcase/showcase.lisp	(original)
+++ trunk/src/lisp/snow/showcase/showcase.lisp	Mon Jan 11 16:38:17 2010
@@ -1,6 +1,7 @@
 (defpackage :snow-showcase
   (:use :common-lisp :snow :java :ext :named-readtables :cells)
-  (:shadowing-import-from :snow #:make-dialog-prompt-stream #:*gui-backend*))
+  (:shadowing-import-from :snow #:make-dialog-prompt-stream #:*gui-backend*
+			  #:self))
 
 (in-package :snow-showcase)
 (in-readtable snow:syntax)
@@ -45,7 +46,7 @@
 
 (defmodel my-model ()
   ((a :accessor aaa :initform (c-in "4"))
-   (b :accessor bbb :initform (c? (concatenate 'string (aaa self) "2")))))
+   (b :accessor bbb :initform (c? (concatenate 'string (aaa cells:self) "2")))))
 
 (defvar *bean* (new "snow.showcase.SnowExample"))
 (defvar *variable* (make-var "42"))




More information about the snow-cvs mailing list