Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can read-time-conditionalization filter reader macros?

8 views
Skip to first unread message

Mirko Vukovic

unread,
Feb 12, 2011, 2:34:36 PM2/12/11
to
I try the following

#+foo #m(1 2 3)

with feature 'foo absent and the reader macro #m undefined.

On clisp 2.49 I get an error about the undefined macro.

Is this a bug or expected failure?

(I believe this was discussed recently, but I could not find the thread).

Thanks,

Mirko

Edmunds Cers

unread,
Feb 12, 2011, 3:13:00 PM2/12/11
to
Mirko Vukovic <mirko....@gmail.com> writes:

> I try the following
>
> #+foo #m(1 2 3)
>
> with feature 'foo absent and the reader macro #m undefined.
>
> On clisp 2.49 I get an error about the undefined macro.

From CLHS 2.4.8.17: "Skipping over the form is accomplished by binding
*read-suppress* to true and then calling read." The section on
*READ-SUPPRESS* says only "Errors such as those that might otherwise be
signaled due to detection of invalid potential numbers, invalid patterns
of package markers, and invalid uses of the dot character are
suppressed." Everything else seems to be read normally. So in my
interpretation Clisp is correct. After all, how could it possibly know
how to skip your syntax extensions? Your syntax could be of the kind "#M
some forms M#", for example.

--
A change in perspective is worth 80 IQ points. --- Alan Kay

Mirko Vukovic

unread,
Feb 12, 2011, 4:48:28 PM2/12/11
to

Yeah, as I thought more about it, I realized that it would be a tall
order for the reader to decide when it should process something as a reader
macro and when not. AI is still not up to that that.

Thanks,

Mirko

0 new messages