Skip to content

Instantly share code, notes, and snippets.

@axelson
Created October 13, 2009 08:28
Show Gist options
  • Save axelson/209102 to your computer and use it in GitHub Desktop.
Save axelson/209102 to your computer and use it in GitHub Desktop.
(defun max-min ()
(loop with num do (setf num (read)) until (eql num 'q)
initially (format t "Please enter numbers (q to quit): ")
maximizing num into max
minimizing num into min
finally (format t "Max: ~a~%Min: ~a" max min)))
(defun pos-power (base exponent)
(if (<= exponent 1) base
(* base (pos-power base (decf exponent)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment