[Openmcl-devel] multiple read-time conditionals, puzzlement
Tim McNerney
mc at media.mit.edu
Mon Mar 13 05:51:07 PDT 2023
Nice investigating. If you want my educated opinion, I think you found a misleading example (#+f #+f x y), explored it to a reasonable extent, and discovered a CCL reader bug:
(setf *features* '(:a :b :c)) followed by '(#+a #-b #+c a b c) reading as (C)
--Tim
> On Mar 13, 2023, at 06:06, Arthur Cater <arthur.cater at ucd.ie> wrote:
>
> Reading a bit of ccl’s sources I came across something that surprised me, and I thought it was neat. It was of the form
>
> #+feat #+feat
> :keyword argument
>
> which I thought nicer than the sort of thing I’d been doing, namely #+feat :keyword #+feat argument
>
>
> But it set me thinking, and experimenting, and now I’m puzzled, and I wonder if anyone can explain this to me.
>
>
>
> ?
> NIL
> ? (setf *features* '(:a :b :c))
> (:A :B :C)
>
> ? '(#+a #+a a b c)
> (A B C)
>
> ? '(#+a #-b a b c)
> (B C)
>
> ? '(#+a #+b #-c a b c)
> (B C)
>
> ? '(#+a #-b #+c a b c)
> (C)
> ?
>
>
> I thought I understood what was going on until this last one. Why does #-b cause both A and B to be skipped?
>
> Arthur
More information about the Openmcl-devel
mailing list