[slime-devel] broken clojure REPL
Terje Norderhaug
terje at in-progress.com
Thu Jan 14 00:11:58 UTC 2010
On Jan 10, 2010, at 12:15 AM, Helmut Eller wrote:
> * Terje Norderhaug [2010-01-09 22:52+0100] writes:
>
>> Now that there are multiple clients and servers, I think it is time
>> that we formalize the lisp syntax of the messages in the swank
>> protocol. It should be simple, limited to a subset of what is allowed
>> by Common Lisp... something parseable with say less than a page of
>> lisp code.
>
> Here's a one page reader:
>
> (defun simple-read ()
> (let ((c (read-char)))
> (case c
> (#\" (with-output-to-string (*standard-output*)
> (loop for c = (read-char) do
> (case c
> (#\" (return))
> (#\\ (write-char (read-char)))
> (t (write-char c))))))
> (#\( (loop collect (simple-read)
> while (ecase (read-char)
> (#\) nil)
> (#\space t))))
> (#\' `(quote ,(simple-read)))
> (t (let ((string (with-output-to-string (*standard-output*)
> (loop for ch = c then (read-char nil nil) do
> (case ch
> ((nil) (return))
> ((#\space #\)) (unread-char ch)
> (return))
> (t (write-char ch)))))))
> (cond ((digit-char-p (aref string 0)) (parse-integer
> string))
> ((intern string))))))))
>
> Now prove or disprove that Slime uses this syntax.
Shouldn't we allow the empty list "()" ?
-- Terje Norderhaug
terje at in-progress.com
More information about the slime-devel
mailing list