Re: Wow, Lisp Reader !!
"Tim Bradshaw (as tfb at cley dot com)" <[email protected]> Sun, 24 May 2026 16:14:59 +0100
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
I think it definitely is the case that the CL reader is not as general-purpose as some parts of the spec might lead you to think: it's really good for things which are pretty like CL's standard syntax with may be some special additions. > On 24 May 2026, at 15:51, David McClain <[email protected]> wrote: > > Wow!! You guys have been wonderful and amazing with all your suggestions. I see that I have been too limited in my approaches. > > I’m really glad I spoke up. Even after 30 years of Lisp experience there is still so much to learn. Pascal, I admire the code you sent along for parsing angles! > > Now here’s the next challenge - can you do a Vulcan mind meld on the user, from the reader, to ascertain Right Ascension from Declination? Hours are stated as 1/15 of Degrees, so 12 hours is the same as 180 degrees. But they appear the same with sexigisimal syntax, 12:00 versus 180:00. > > > >> On May 24, 2026, at 07:40, Tim Bradshaw <[email protected]> wrote: >> >> (defvar *rt* (copy-readtable nil)) >> >> (set-macro-character >> #\' >> (get-macro-character #\' *readtable*) >> t *rt*) >> >> Now >> >> ? (setf *readtable* *rt*) >> #<readtable 8170521CF3> >> >> ? 'foo'bar'bang >> foo\'bar\'bang >> >> Same for the others. You just need to make the read-macros be nonterminating. >> >