X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=math.lisp;h=682cd74027776f7dfc5a3d4346c7a0ab2be55f50;hb=f02806a9c747318814e3b46520d2ceebd6031488;hp=9772b7a52df849bfee3b40b4eebb4f5a6162c541;hpb=d78955696cc7e6fa8c50a880085c019f506c8bd9;p=kmrcl.git diff --git a/math.lisp b/math.lisp index 9772b7a..682cd74 100644 --- a/math.lisp +++ b/math.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Nov 2002 ;;;; -;;;; $Id: math.lisp,v 1.1 2002/11/08 06:43:34 kevin Exp $ +;;;; $Id: math.lisp,v 1.4 2003/06/06 21:59:29 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -17,8 +17,7 @@ ;;;; ************************************************************************* -(in-package :kmrcl) -(declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3))) +(in-package #:kmrcl) (defun deriv (f dx) #'(lambda (x) @@ -29,3 +28,9 @@ (funcall (deriv #'sin 1d-8) x)) ;;; (sin^ pi) + +(defmacro ensure-integer (obj) + "Ensure object is an integer. If it is a string, then parse it" + `(if (stringp ,obj) + (parse-integer ,obj) + ,obj))