[slime-devel] broken clojure REPL

Tobias C. Rittweiler tcr at freebits.de
Sat Jan 9 14:59:16 UTC 2010

"Steven E. Harris" <seh at panix.com> writes:

> "Tobias C. Rittweiler" <tcr at freebits.de> writes:
>> The clojure backend should parse the input itself, and pass the symbol
>> name over to INTERN.
> It sounds like the problem here is that the Clojure Swank backend is
> parsing forms received using `read', and it's choking on reading symbols
> that violate its syntax. Can someone confirm that that's the case?
> If so, it's a shame to not be able to use a Lisp reader to read what
> look very much like Lisp forms. Studying the Clojure reader
> documentation¹, there's no mention a symbol escape syntax.

The point is that you're not trying to use a Lisp reader to read what
looks very much like Lisp forms, but you're trying to use the Clojure
reader. And the Clojure reader is very restrictive in what it accepts as

> As a compromise, would it be possible to have the Swank backend
> initialize this cursor treatment by /sending/ a symbol to the SLIME
> client, which the client would have for that session and use instead of
> the symbol swank::%cursor-marker%?
> Instead of being a constant, the current slime-cursor-marker could be
> provided as an argument to `slime-parse-form-upto-point'. Of course,
> it's possible that the backend could provide a symbol that isn't valid
> in ELisp, which just turns the problem around.

The easiest compromise is to change %CURSOR-MARKER% to +CURSOR-MARKER+
which, if I read the documentation right, the Clojure reader will
accept. Doing so, is sweeping a problem under the carpet.

I still think that it is Clojure that should "change". It should provide
a way to READ in a form with minimal processing -- something that CL's
reader, for instance, does not really allow to unfortunate consequences.

It is useful to be able to minimally READ in a possibly untrusted data
file -- without processing of reader macros, without interning. You get
back forms of numbers, symbols (whose symbol-name is exactly the
original textual representation), and possibly other data types that you
allow by enabling their reader macros.

Has anyone brought that up on a Clojure devel list?


More information about the slime-devel mailing list