I'm clearing my queue of stuff seen on comp.lang.lisp recently.
? (critique (defun count-a (lst) (setq n 0) (dolist (x lst) (if (equal x 'a) (setq n (+ n 1)))) n)) ++++++++++ SETS-GLOBALS: GLOBALS!! Don't use global variables, i.e., N N ++++++++++ DOLIST-SETF: Don't use SETQ inside DOLIST to accumulate values for N. Use DO. Make N a DO variable and don't use SETQ etc at all. ++++++++++ USE-EQL: Unless something special is going on, use EQL, not EQUAL. ++++++++++ X-PLUS-1: Don't use (+ N 1), use (1+ N) for its value or (INCF N) to change N, whichever is appropriate here. ++++++++++Posted by jjwiseman at December 04, 2002 10:30 AM