<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.lisp.editors.hints.devel">
    <title>gmane.lisp.editors.hints.devel</title>
    <link>http://blog.gmane.org/gmane.lisp.editors.hints.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.lisp.editors.hints.devel/36"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.lisp.editors.hints.devel/35"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.lisp.editors.hints.devel/34"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.lisp.editors.hints.devel/33"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.lisp.editors.hints.devel/32"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.lisp.editors.hints.devel/36">
    <title>Patch to support cmucl/unicode</title>
    <link>http://comments.gmane.org/gmane.lisp.editors.hints.devel/36</link>
    <description>&lt;pre&gt;The patch below adds support for cmucl/unicode.  This basically adds an
implementation of %make-readtable-iterator, updates %clear-readtable for
cmucl (like sbcl), a fix for %get-dispatch-macro-character, a fix for
%get-macro-character (like allegro).

With these changes (and a small change in named-readtables.lisp  that
has already been mentioned by Stas Boukarev last month. 

With these changes cmucl passes all 36 of the tests.

Oh, one thing.  I noticed that in %clear-readtable, the last sexp is
#+common-lisp.  CMUCL has the :common-lisp feature, so the table is set
twice.  Perhaps this is oversight and the reader conditional should be
#-(or allegro sbcl cmu)?

Ray

Change log:

 * Add implementation of %make-readtable-iterator for cmucl/unicode.
 * Implement %clear-readtable for cmucl.

 * Make %get-dispatch-macro-character return NIL where cmucl actually
   has #'lisp::dispatch-char-error.  It seems named-readtables wants
   this.
 * Update %get-macro-character for cmucl, which behaves like allegro
   here.


diff -u --recursive ./cruft.lisp
/Volumes/share2/src/sourceforge/matlisp/matlisp-cvs/lib-src/named-readtables-0.9/cruft.lisp
--- ./cruft.lisp    2009-10-10 04:19:32.000000000 -0400
+++
/Volumes/share2/src/sourceforge/matlisp/matlisp-cvs/lib-src/named-readtables-0.9/cruft.lisp   
2011-01-28 00:49:30.000000000 -0500
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -235,8 +235,55 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
                                                      subch-fn))))))))
       #'grovel-macro-chars)))
 
+;; This really only needed for CMUCL with unicode support.  Without
+;; unicode, the default implementation is probably fast enough.
+#+(and cmu unicode)
+(defun %make-readtable-iterator (readtable)
+  (let ((char-macro-ht    (lisp::character-macro-hash-table readtable))
+        (dispatch-tables  (lisp::dispatch-tables readtable))
+        (char-code 0))
+    (with-hash-table-iterator (ht-iterator char-macro-ht)
+      (labels ((grovel-base-chars ()
+                 (if (&amp;gt;= char-code lisp::attribute-table-limit)
+                     (grovel-unicode-chars)
+             (let* ((char      (code-char (shiftf char-code (1+
char-code))))
+                ;; Need %get-macro-character here, not
+                ;; get-macro-character because we want NIL
+                ;; to be returned instead of
+                ;; #'lisp::read-token.
+                (reader-fn (%get-macro-character char readtable)))
+               (if reader-fn
+               (yield char reader-fn)
+               (grovel-base-chars)))))
+               (grovel-unicode-chars ()
+                 (multiple-value-bind (more? char reader-fn)
+             (ht-iterator)
+                   (if (not more?)
+                       (values nil nil nil nil nil)
+                       (yield char reader-fn))))
+               (yield (char reader-fn)
+                 (let ((disp-ht))
+                   (cond
+                     ((setq disp-ht (cdr (assoc char dispatch-tables)))
+                      (let ((disp-fn (get-macro-character char readtable))
+                (sub-char-alist))
+            (if (&amp;lt; (char-code char) lisp::attribute-table-limit)
+                (let ((disp (lisp::char-dispatch-table-table disp-ht)))
+                  (dotimes (k lisp::attribute-table-limit)
+                (let ((f (aref disp k)))
+                  (unless (eq f #'lisp::dispatch-char-error)
+                    (push (cons (code-char k) f)
+                      sub-char-alist)))))
+                (let ((disp-ht (lisp::char-dispatch-table-hash-table
disp-ht)))
+                  (maphash (lambda (k v)
+                     (push (cons k v) sub-char-alist))
+                       disp-ht)))
+                        (values t char disp-fn t sub-char-alist)))
+                     (t
+                      (values t char reader-fn nil nil))))))
+        #'grovel-base-chars))))
 
-#-(or sbcl clozure allegro)
+#-(or sbcl clozure allegro (and cmu unicode))
 (eval-when (:compile-toplevel)
   (let ((*print-pretty* t))
     (simple-style-warn
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -246,7 +293,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
        On Unicode-aware implementations this may come with some
costs.~&amp;lt; at &amp;gt;:&amp;gt;"
      (package-name '#.*package*) (lisp-implementation-type))))
 
-#-(or sbcl clozure allegro)
+#-(or sbcl clozure allegro (and cmu unicode))
 (defun %make-readtable-iterator (readtable)
   (check-type readtable readtable)
   (let ((char-code 0))
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -325,6 +372,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     (do-readtable (char readtable)
       (set-syntax-from-char char #\A readtable))
     (setf (sb-impl::dispatch-tables readtable) nil))
+  #+:cmu
+  (prog1 readtable
+    (do-readtable (char readtable)
+      (set-syntax-from-char char #\A readtable))
+    (setf (lisp::dispatch-tables readtable) nil))
   #+ :allegro
   (prog1 readtable
     (do-readtable (char readtable)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -343,17 +395,28 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   "Ensure ANSI behaviour for GET-DISPATCH-MACRO-CHARACTER."
   #+ :ccl         (ignore-errors
                     (get-dispatch-macro-character char subchar rt))
-  #+ :common-lisp (get-dispatch-macro-character char subchar rt))
+  #+cmu
+  (let ((f (get-dispatch-macro-character char subchar rt)))
+    ;; CMUCL returns #'lisp::dispatch-char-error, and named-readtables
+    ;; wants nil in those cases.
+    (unless (eq f #'lisp::dispatch-char-error)
+    f))
+  #-(or :ccl :cmu) (get-dispatch-macro-character char subchar rt))
 
 ;;; Allegro stores READ-TOKEN as reader macro function of each
-;;; constituent character.
+;;; constituent character.  CMUCL does the same.
 (define-cruft %get-macro-character (char rt)
   "Ensure ANSI behaviour for GET-MACRO-CHARACTER."
   #+ :allegro     (let ((fn (get-macro-character char rt)))
                     (cond ((not fn) nil)
                           ((function= fn #'excl::read-token) nil)
                           (t fn)))
-  #+ :common-lisp (get-macro-character char rt))
+  #+cmu
+  (let ((fn (get-macro-character char rt)))
+    (cond ((not fn) nil)
+      ((function= fn #'lisp::read-token) nil)
+      (t fn)))
+  #-(or :allegro cmu) (get-macro-character char rt))
&lt;/pre&gt;</description>
    <dc:creator>Raymond Toy</dc:creator>
    <dc:date>2011-01-28T06:07:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.lisp.editors.hints.devel/35">
    <title>named-readtables/SLIME interaction problem</title>
    <link>http://comments.gmane.org/gmane.lisp.editors.hints.devel/35</link>
    <description>&lt;pre&gt;
I ran into a problem with SLIME where I was getting errors the second time I would compile a buffer with contents such as the following:


(cl:eval-when (:compile-toplevel :load-toplevel :execute)
 (ql:quickload 'named-readtables))

(defpackage #:reader-macro-test
  (:use #:cl))

(in-package #:reader-macro-test)

(eval-when (:compile-toplevel :load-toplevel :execute)
  (named-readtables:defreadtable readtable-test
    (:merge :standard)))

(named-readtables:in-readtable readtable-test)


It turns out that the problem has to do with the way SLIME deals with the style-warning that the defreadtable gives about overwriting the existing readtable. The defreadtable form clears out the bindings for the existing reader, then issues the warning. SLIME parses the buffer and picks up that we're in the #:reader-macro-test package and sets *readtable* to be the readtable that we've just clobbered and then in SLIMEs error/warning handling code it further frobs (a copy of) the (now empty-ish) readtable and then attempts to read using that readtable and fails.

Tobias rightly points out that SLIME should have better support for named-readtables. It also seems to me that SLIME might want to make greater assurances about the state of the reader in its error handling code.

But the simple, expedient fix is:

--- named-readtables.lisp2011-01-27 09:14:38.000000000 -0800
+++ /Users/sly/quicklisp/dists/quicklisp/software/named-readtables-20101006-darcs/named-readtables.lisp2011-01-27 13:36:53.000000000 -0800
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -132,9 +132,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
               (cond ((not readtable)
                      (setq readtable (make-readtable ',name)))
                     (t
-                     (setq readtable (%clear-readtable readtable))
                      (simple-style-warn "Overwriting already existing readtable ~S."
-                                        readtable)))
+                                        readtable)
+                     (setq readtable (%clear-readtable readtable))))
               ,&amp;lt; at &amp;gt;(loop for option in merge-clauses
                       collect (process-option option 'readtable))
               ,&amp;lt; at &amp;gt;(loop for option in case-clauses

Explicit SLIME support for named-readtables would be great, but, in the meantime, it would be nice to see this in the named-readtables source.

Thanks,

Cyrus
&lt;/pre&gt;</description>
    <dc:creator>Cyrus Harmon</dc:creator>
    <dc:date>2011-01-27T21:41:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.lisp.editors.hints.devel/34">
    <title>[Patch]: CMUCL and Allegro 8.2 fixes</title>
    <link>http://comments.gmane.org/gmane.lisp.editors.hints.devel/34</link>
    <description>&lt;pre&gt;The default value of error-p optional parameter for
excl:named-readtable was changed to T in Allegro 8.2, which causes
errors whenever find-readtable is called on non existent readtable.

CMUCL has an issue with ordering of loop initializations in the loop of
define-api macro. And the spec is quite confusing on how it really should behave.
The workaround is to use (progn x (loop ...)) instead of (loop initially x ...)



&lt;/pre&gt;</description>
    <dc:creator>Stas Boukarev</dc:creator>
    <dc:date>2010-12-09T10:09:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.lisp.editors.hints.devel/33">
    <title>Regarding hyperdoc</title>
    <link>http://comments.gmane.org/gmane.lisp.editors.hints.devel/33</link>
    <description>&lt;pre&gt;
luis/lichtblau,

Wrt our discussion on yesterday's evening, I think that
REGISTER-DOCUMENTATION should probably become a macro which expands to
symbols in *PACKAGE* only -- in particular, it does not expand to
symbols from the HYPERDOC package so not to impose a runtime dependency.

Essentially that is to restore to the old ways of doing things --
although the API has changed somewhat.

I didn't (and still don't) like the set-some-magic-variables way as an
_interface_ which was the reason I came up with
REGISTER-DOCUMENTATION. It seems to be the right implementation choice,
though.

Are you d'accord?

  -T.
&lt;/pre&gt;</description>
    <dc:creator>Tobias C. Rittweiler</dc:creator>
    <dc:date>2009-12-09T08:19:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.lisp.editors.hints.devel/32">
    <title>[ANN] Named Readtables 0.9</title>
    <link>http://comments.gmane.org/gmane.lisp.editors.hints.devel/32</link>
    <description>&lt;pre&gt;
The [editor-hints] project is pleased to announce _Named Readtables_.


What are Named Readtables?

  It's a library

       a) to help you to organize your readtable hacks, 
   
   and b) to help your development environment to deal with these hacks.

  For detailed information see [What are Named-Readtables?] in the
  documentation.


Foretaste

  DEFREADTABLE (analogously to DEFPACKAGE) can be used to specify the
  content of a readtable.

  IN-READTABLE (analogously to IN-PACKAGE) can be used to specify what
  readtable should be used while compiling a .lisp file.

  Named-Readtables has an API very much inspired by the existing API
  of packages. But see [Important API idiosyncrasies] in the
  documentation.


Documentation

  See [Named-Readtables Documentation].


Download

  darcs get http://common-lisp.net/project/editor-hints/darcs/named-readtables/


Release Notes

  The release was tagged as 0.9 even though it's actually pretty much a 1.0.

  Experience tells that no matter how much you try to polish a piece
  of software, there will be two to three issues. The 1.0 will wait
  for these issues be reported.

  
Implementations

  The library has been tested on SBCL, CCL, Clisp, ABCL (head), ECL,
  Allegro 8.1, Lispworks 5.1.


Links

  [editor-hints] 

     http://common-lisp.net/project/editor-hints/

  [Named-Readtables Documentation]

     http://common-lisp.net/project/editor-hints/darcs/named-readtables/doc/named-readtables.html

  [What are Named-Readtables?]

     http://common-lisp.net/project/editor-hints/darcs/named-readtables/doc/named-readtables.html#what_are_named-readtables?

  [Important API idiosyncrasies]

     http://common-lisp.net/project/editor-hints/darcs/named-readtables/doc/named-readtables.html#important_api_idiosyncrasies
&lt;/pre&gt;</description>
    <dc:creator>Tobias C. Rittweiler</dc:creator>
    <dc:date>2009-10-10T10:29:52</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.lisp.editors.hints.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.lisp.editors.hints.devel</link>
  </textinput>
</rdf:RDF>
