SparQ icon indicating copy to clipboard operation
SparQ copied to clipboard

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

Open lispm opened this issue 8 years ago • 0 comments

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.

lispm avatar May 20 '17 09:05 lispm