Skip to content

don't use EQ with characters and numbers, use EQL instead #6

@lispm

Description

@lispm

EQ in Common Lisp is not for comparison of characters and numbers. Characters and numbers have no identity and may be copied by an implementation. Thus effectively comparing 3 and 3 with EQ can be T or NIL. Same with characters.

The default comparison operator is EQL. EQL also works for characters and numbers.

See: http://www.lispworks.com/documentation/lw51/CLHS/Body/f_eql.htm

The software seams to have various usage of EQ to compare numbers and characters. That can lead to strange runtime behavior.

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