From: John R. "Bob" Bane
Subject: Disabling colon in readtable?
Date: 
Message-ID: <4p23qq$jp@tove.cs.umd.edu>
Is there any way to disable the package-delimiter function of the colon
in a Common Lisp readtable?  The following fails in Allegro 4.2:

(defvar *hack* (copy-readtable nil))

(defun test-hack nil
  (let ((*readtable* *hack*))
    (declare (special *readtable*))
       (read-from-string "foo:bar")))

;;
;; Doing these has no effect; (test-hack) still breaks
;;
(set-syntax-from-char #\: #\a *hack* *hack*)
(set-macro-character #\: (get-macro-character #\a *hack*) t *hack*)

Am I missing something, or is there something strange about Allegro CL?
At the moment, I would even accept a non-portable solution that worked.

	- Bob Bane
-- 
Internet: ยทยทยทยท@tove.cs.umd.edu
Voice: 301-552-4860
From: Erik Naggum
Subject: Re: Disabling colon in readtable?
Date: 
Message-ID: <3042924295487785@arcana.naggum.no>
[John R. "Bob" Bane]

|   Is there any way to disable the package-delimiter function of the colon
|   in a Common Lisp readtable?

when I went looking for this some months ago, I looked at the internals in
CMUCL and found a work-around.  this is most probably completely local to
CMUCL, but it may indicate that there is hope, if nothing else:

    (set-syntax-from-char #\: #\a *readtable* *readtable*)
    (common-lisp::set-secondary-attribute #\: 
      (common-lisp::get-secondary-attribute #\a))

now,

    (read-from-string "foo:bar")
 => |FOO:BAR|

I never bothered to look for the magic in the symbol printer, but it seems
that some similar internal table hackery is needed.  pity they aren't just
a little bit more programmer-friendly.

|   Am I missing something, or is there something strange about Allegro CL?

once a symbol is started by a constituent, the package-delimiter is part of
the internal makeup of a symbol.  like numbers, these are not read by user
code or macro characters, but by the reader itself.  unfortunately, this is
the one part of the reader that is not user configurable, either.  bummer.

-- 
sometimes a .sig is just a .sig