Closed TsarFox closed 4 years ago
Fails with a "The function COMMON-LISP-USER::& is undefined." This is different behavior than, say + or *.
There are multiple things to unpack:
(SYMBOL …)
as "semantic predicates" which involve calling the function named by SYMBOL
when SYMBOL
is not one of the built-in operators. That's why the error message is "The function COMMON-LISP-USER::& is undefined.".+
and *
are actually cl:+
and cl:*
. These symbols are used for multiple things (they name functions, *
is used in type specifiers). Esrap uses them (and others such as cl:and
and cl:or
) as parsing-related operators.&
on the other hand is not a symbol in the common-lisp
package (same for !
, ?
and ~
). As a consequence, if you write your code in the common-lisp-user
package, &
is read as comon-lisp-user::&
which is not a symbol Esrap knows about.You should be able to refer to the Esrap operator as esrap:&
. Using esrap::&
(i.e. two colons) should not be necessary since the symbol is exported from the esrap
package.
I see, thanks for the explanation!
Hey,
So the following works:
And so does
But this does not:
Fails with a "The function COMMON-LISP-USER::& is undefined." This is different behavior than, say
+
or*
.My apologies if I'm misunderstanding how Esrap is supposed to work.