From: Dieter K. <cra...@us...> - 2010-01-02 12:01:31
|
Update of /cvsroot/maxima/maxima/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7822/src Modified Files: mlisp.lisp Log Message: Adding a function posintegerset: The function can be used as an 'assign property to check for a positive integer assignment. Related bug report: Bug ID: 2920190 - non-integer value for maxposex No problems with the testsuite. Index: mlisp.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/mlisp.lisp,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- mlisp.lisp 22 Nov 2009 04:53:36 -0000 1.82 +++ mlisp.lisp 2 Jan 2010 12:01:19 -0000 1.83 @@ -1158,7 +1158,17 @@ (defmfun neverset (x assign-val) (declare (ignore assign-val)) - (if munbindp 'munbindp (merror (intl:gettext "assignment: cannot assign to ~:M") x))) + (if munbindp + 'munbindp + (merror (intl:gettext "assignment: cannot assign to ~:M") x))) + +;; Check assignment to be a positive integer including zero +(defun posintegerset (x y) + (if (or (not (integerp y)) + (not (>= y 0))) + (merror + (intl:gettext "assignment: '~:M must be a positive integer. Found: ~:M") + x y))) (defmfun mmapev (l) (if (null (cddr l)) |