4 ms·
Regarding the code, its ok although there are some parts that are unnecessarily messy. Here[0], and in other parts you use labels in the middle the function. It
by PuercoPop 10y ago
Regarding the code, its ok although there are some parts that are unnecessarily messy. Here[0], and in other parts you use labels in the middle the function. It is best to do in the outer level form. I like the rlabels of misc-extension[1] when using local functions but I understand most people would prefer not to add 'util' dependencies. Another thing in that function. The (let ((data (or ...)))) is unnecessary. You place the form in the default case of the keyword argument So it would end up looking like:
(defun x-find-color (rgba &key (x 0) (y 0)
(width default-width) (height default-height)
(test #'equal)
(snap-data (x-snapshot :x x :y y :width width :height height)))
...)
Also if not using asdf, the quickload form should be wrapped in an eval-when. It will fail If I Try to compile the file (C-c C-k) on a fresh session.
This are nitpicks, the code is understandable and easy to read. Nice writeup and cool idea!
[0]: https://github.com/VitoVan/cl-dino/blob/master/cl-autogui.lisp#L173 https://github.com/VitoVan/cl-dino/blob/master/cl-autogui.li...
[1]: https://github.com/slburson/misc-extensions https://github.com/slburson/misc-extensions
- daveloyall 10y ago> Also if not using asdf, the quickload form should be > wrapped in an eval-when. It will fail If I Try to > compile the file (C-c C-k) on a fresh session. OH! Thank you... :) That's always bugged me!
- VitoVan 10y agoThank you PuercoPop, I am learning Common Lisp, your comment helps me a lot, problem fixing...