Skip to content

Bug in diamond wand equality #4

@dtenny

Description

@dtenny

Hi there. Just a note that there is a small problem if you want to diamond wand substitutions without :USE-ing the arrow-macros package. For example

(ql:quickload :arrow-macros)
(arrow-macros:-<>> 1 (print <>))

Yields

The variable <> is unbound.
   [Condition of type UNBOUND-VARIABLE]

This is because has-diamond (and similar checks) are using (eq exp '<>) which fails if the symbol was interned in a different package than the :arrow-macros package.

Instead you probably need a check like this:

(and (symbolp exp)
     (string= exp "<>"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions