How do I increment or decrement a number in Common Lisp?
What is the idiomatic Common Lisp way to increment/decrement numbers and/or numeric variables? Use the built-in "+" or "-" functions, or their shorthand "1+" or "1-", if you just want to use the result, without modifying the original number (the argument). If you do want to modify the original place (containing a number), then use the built-in "incf" or "decf" functions. Using the addition operator: (setf num 41) (+ 1 num) ; returns 42, does not modify num (+ num 1) ; returns 42, does not modify num (- num 1) ; returns 40, does not modify num (- 1 num) ; NOTE: returns -40, since a - b is not