Re: Lisp Reader & Tools

"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]> Wed, 27 May 2026 13:15:27 -0700
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Almost there, using Unicode…

But LW has some sneaking equivalence mappings going on under the hood, and balks at my using U+2019 as a substitute for ASCII quote #\’.  

So dropping back to setting #\’ to a non-terminating macro. It doesn’t print correctly, as LW is using the readtable for figuring out how to display symbol names. But at least I’m permitted by the reader to use quote as a suffix.

So now I can enter angles as  -10°23'13”.36 using U+201D as the arcsec indicator, not ASCII quote.



> On May 27, 2026, at 13:00, Marco Antoniotti (as marco dot antoniotti at unimib dot it) <[email protected]> wrote:
> 
> I am pretty sure that you can convince at least LW and SBCL to play nice with UNICODE characters.
> 
> MA
> 
> On Wed, May 27, 2026 at 8:45 PM David McClain <[email protected] <mailto:[email protected]>> wrote:
>> Thanks, that’s a really cool idea!!  
>> 
>> But the Lisp tools still suffer from assumptions like I mentioned. You have to insert comments in your code at strategic places to put in a “ or a \ or a | to make the editor and REPL happy. Otherwise they refuse to allow you to compile or exectue a sexpr because a lone char is preset in the sexpr text.
>> 
>>> On May 27, 2026, at 11:41, Marco Antoniotti <[email protected] <mailto:[email protected]>> wrote:
>>> 
>>> Kludgy workaround: use a #\FUNKY-UNICODE-NOT-ANSI-SINGLE-QUOTE and a #\FUNKY-UNICODE-NOT-ANSI-DOUBLE-QUOTE to define reader macros on.
>>> I am sure such characters are there in UNICODE.
>>> 
>>> MA
>>> 
>>> 
>>> On Wed, May 27, 2026 at 8:30 PM David McClain (as dbm at refined-audiometrics dot com) <[email protected] <mailto:[email protected]>> wrote:
>>>> Turns out Richard Gabriel was hiding something in his "Worse is Better”. Lisp, and I suspect many other ancient languages, made use of some grand assumptions based on the 1-char lookahead. And they assumed that tools like text-editors could discern important boundaries via simple regular expression matching.
>>>> 
>>>> This is not the very best that can be had, contrary to the MIT Thesis put forth by Gabriel. Lisp, it turns out, makes many assumptions about inputs, just like Forth does. It works well for properly formed inputs. But all bets are off otherwise.
>>>> 
>>>> And this worked marvelously well for now near 75 years. But I have found its limits.
>>>> 
>>>> I wanted to extend the reader syntax to allow for angle input formats like you see printed in the ephemerides, 1°23’13”.234
>>>> 
>>>> And I can almost get away with it, except for the “ mark on the arc-seconds portion.
>>>> 
>>>> Similar things happen with reader macros that inhale arbitrary chars when they run into things like | (vbar) and \ (backslash). The reader macros handle it just fine, but the text editors do not.
>>>> 
>>>> A more modern approach would chop up the incoming text through a lexical analyzer into tokens. And the edits would be applied to tokens, not regex matches.
>>>> 
>>>> _______________________________________________
>>>> Lisp Hug - the mailing list for LispWorks users
>>>> [email protected] <mailto:[email protected]>
>>>> http://www.lispworks.com/support/lisp-hug.html
>>> 
>>> 
>>> 
>>> --
>>> Marco Antoniotti, Professor, Director         tel. +39 - 02 64 48 79 01
>>> DISCo, University of Milan-Bicocca U14 2043   http://dcb.disco.unimib.it <http://dcb.disco.unimib.it/>
>>> Viale Sarca 336
>>> I-20126 Milan (MI) ITALY
>>> 
>>> REGAINS: https://regains.disco.unimib.it/
>> 
> 
> 
> 
> --
> Marco Antoniotti, Professor, Director         tel. +39 - 02 64 48 79 01
> DISCo, University of Milan-Bicocca U14 2043   http://dcb.disco.unimib.it <http://dcb.disco.unimib.it/>
> Viale Sarca 336
> I-20126 Milan (MI) ITALY
> 
> REGAINS: https://regains.disco.unimib.it/