Closed kilianmh closed 2 years ago
If x may be NIL or a number, (eql x 42) is perfectly fine.
On Sun, Jul 17, 2022 at 1:20 PM Kilian M. Haemmerle < @.***> wrote:
Most of these changes are stylistic (improvements). Exceptions are:
- Fix EQL on numbers https://github.com/quicklisp/quicklisp-client/commit/fc5baddb65f9817a688bb175f2d51227d96b3244 : Using = to compare numbers is better, since = signals a type-error if supplied non-number, while EQL does not.
- Fix needless list building in mapping operation https://github.com/quicklisp/quicklisp-client/commit/1caa8a9f356513dea08c28ee64e5981e793591e9 : MAPC improves performance when values are not used, since MAPCAR builds a list (consing), while MAPC does not.
Inspired by lisp-critic https://github.com/g000001/lisp-critic/ 40ants-critic https://github.com/40ants/40ants-critic.
You can view, comment on, or merge this pull request online at:
https://github.com/quicklisp/quicklisp-client/pull/218 Commit Summary
- 4af0894 https://github.com/quicklisp/quicklisp-client/pull/218/commits/4af0894b47d49e77d590f7fe41f3e9cae9ed2eba Initialize LET variable bindings with NIL
- 1a0af15 https://github.com/quicklisp/quicklisp-client/pull/218/commits/1a0af157cc0abbcd467c44d32bafdf7c55fef2a2 Use COND instead of IF and PROGN
- ed52905 https://github.com/quicklisp/quicklisp-client/pull/218/commits/ed52905702ab7fc8736d6e7086438e607a72fa22 Flat COND instead of nested ELSE branches
- 5ff40da https://github.com/quicklisp/quicklisp-client/pull/218/commits/5ff40dab30fd468b64a453ce4a6fd642c2d9a4f2 Substitute LET* with LET
- 5406198 https://github.com/quicklisp/quicklisp-client/pull/218/commits/54061986c0df374696629140c5dac91a8d35f51b Substitute (IF test T else) with (OR test else)
- 287586a https://github.com/quicklisp/quicklisp-client/pull/218/commits/287586a450faf89bb9343bac324c3a9d3ddd537d Use (UNLESS ...) instead of (WHEN (NOT ...))
- fc5badd https://github.com/quicklisp/quicklisp-client/pull/218/commits/fc5baddb65f9817a688bb175f2d51227d96b3244 Fix EQL on numbers
- 59f33a4 https://github.com/quicklisp/quicklisp-client/pull/218/commits/59f33a4ac05093cee09555e3e3294edf8eebdc84 Replace (EQL ... NIL) with (NULL ...)
- 1caa8a9 https://github.com/quicklisp/quicklisp-client/pull/218/commits/1caa8a9f356513dea08c28ee64e5981e793591e9 Fix needless list building in mapping operation
File Changes
(7 files https://github.com/quicklisp/quicklisp-client/pull/218/files)
- M quicklisp/client-info.lisp https://github.com/quicklisp/quicklisp-client/pull/218/files#diff-d0fd019990a62322ca08edd6e910a6df4946f759c72248b0656e8f09de515ba7 (10)
- M quicklisp/client.lisp https://github.com/quicklisp/quicklisp-client/pull/218/files#diff-52c9d7a97258d927a830266b98cbbe384ff27e72db93bd6408f77c39b28c3adf (2)
- M quicklisp/http.lisp https://github.com/quicklisp/quicklisp-client/pull/218/files#diff-22beba7ceeeb0137c940f7b187cb851e5c8f01ef7afc2c08ac97fa192e486d46 (48)
- M quicklisp/impl-util.lisp https://github.com/quicklisp/quicklisp-client/pull/218/files#diff-71a56da3f3c1aeffd001063a364f19327e35ab335153c174aa6e8e3b79a48a4e (12)
- M quicklisp/local-projects.lisp https://github.com/quicklisp/quicklisp-client/pull/218/files#diff-ff1e008362fbf92849463e866ffc07db5f2a2d78221e8a20f376cbdb5a8e0e4c (8)
- M quicklisp/network.lisp https://github.com/quicklisp/quicklisp-client/pull/218/files#diff-f62420438062176197297ee5ceea08cc9b7c288b30010111743ab88dcb354ffb (2)
- M quicklisp/setup.lisp https://github.com/quicklisp/quicklisp-client/pull/218/files#diff-f1dbcff33a256cbfe16e3b02031e2806f2991f0276dd52df8be7bd59ef184577 (2)
Patch Links:
- https://github.com/quicklisp/quicklisp-client/pull/218.patch
- https://github.com/quicklisp/quicklisp-client/pull/218.diff
— Reply to this email directly, view it on GitHub https://github.com/quicklisp/quicklisp-client/pull/218, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPNLP3RTCB7C3WP7AT2ILVUQ6FXANCNFSM532BZIPQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
If x may be NIL or a number, (eql x 42) is perfectly fine.
Indeed, that is correct! Now the case when the object might be NIL is EQL again.
If there's anything else stopping you to merge this, just let me know.
PS: Will try to put this exemption-case in the lisp-critic rule-description.
Most of these changes are stylistic (improvements). Exceptions are:
=
to compare numbers is better, since=
signals a type-error if supplied non-number, whileEQL
does not.MAPC
improves performance when values are not used, sinceMAPCAR
builds a list (consing), whileMAPC
does not.Inspired by lisp-critic/40ants-critic.