[Openmcl-devel] New string syntax and the listener

Ron Garret ron at awun.net
Tue Jul 21 23:47:10 PDT 2009


I want to be able to write strings using European quotes «like this».   
So I do this:

(defun \«-reader (stream c)
  (declare (ignore c))
  (with-output-to-string (s)
    (loop for c = (read-char stream)
      until (eql c #.(elt "»" 0))
      do (princ c s))
    s))

(set-macro-character #.(elt "«" 0) '\«-reader t)

It works, but it interacts badly with the listener.  If I type a  
string in this new style at the listener and hit return, nothing  
happens until I type another form.  Is there a way to work around  
this?  How does the listener decide when there's a complete form for  
it to evaluate?

(BTW, the reason I'm using #.(elt "«" 0) instead of #\« is that #\«  
syntax seems to be broken in the latest release.)

Thanks,
rg




More information about the Openmcl-devel mailing list