[armedbear-cvs] r12926 - trunk/abcl/src/org/armedbear/lisp

Ville Voutilainen vvoutilainen at common-lisp.net
Mon Sep 27 20:31:44 UTC 2010


Author: vvoutilainen
Date: Mon Sep 27 16:31:43 2010
New Revision: 12926

Log:
This patch fixes these two issues in ABCL 0.22.0:

1) Keyword evaluation in the repl is broken. The repl assumes all
keywords are, in fact, repl commands.

2) Repl commands are case sensitive: :help :HELP mean two different things.

Patch by Mahmud Mohamed. On behalf of abcl developers, welcome aboard!


Modified:
   trunk/abcl/src/org/armedbear/lisp/top-level.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/top-level.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/top-level.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/top-level.lisp	Mon Sep 27 16:31:43 2010
@@ -348,8 +348,8 @@
       (setf string (subseq string 1)
             len (1- len)))
     (dolist (entry *command-table*)
-      (when (or (string= string (entry-abbreviation entry))
-                (string= string (entry-name entry)))
+      (when (or (string-equal string (entry-abbreviation entry))
+                (string-equal string (entry-name entry)))
         (return (entry-command entry))))))
 
 (defun process-cmd (form)
@@ -376,13 +376,17 @@
 
 (defun read-cmd (stream)
   (let ((c (peek-char-non-whitespace stream)))
-    (cond ((eql c *command-char*)
-           (read-line stream))
-          ((eql c #\newline)
-           (read-line stream)
-           *null-cmd*)
-          (t
-           (read stream nil)))))
+    (if (eql c #\Newline)
+	(progn
+	  (read-line stream)
+	  *null-cmd*)
+	(let ((input (read stream nil)))
+	  (if (not (keywordp input))
+	      input
+	      (let ((name (string-downcase (symbol-name input))))
+		(if (find-command name)
+		    (concatenate 'string ":" name)
+		    input)))))))
 
 (defun repl-read-form-fun (in out)
   (loop




More information about the armedbear-cvs mailing list