diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet index 1404c79..f7084c4 100644 --- a/books/bookvol10.3.pamphlet +++ b/books/bookvol10.3.pamphlet @@ -144395,8 +144395,8 @@ XRecursivePolynomial(VarSet:OrderedSet,R:Ring): Xcat == Xdef where -- local functions construct: LTERMS -> REGPOLY simplifie: VPOLY -> % - lquo1: (LTERMS,LTERMS) -> % ++ a ajouter - coef1: (LTERMS,LTERMS) -> R ++ a ajouter + lquo1: (LTERMS,LTERMS) -> % -- a ajouter + coef1: (LTERMS,LTERMS) -> R -- a ajouter outForm: REGPOLY -> EX --define diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 811c569..97338eb 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -37631,6 +37631,39 @@ an AssociationList representation \end{chunk} +\section{Plot3d} +We catch numeric errors and throw a different failure than normal. +The trapNumericErrors macro will return a pair of the the form +{\tt Union(type-of-form, "failed")}. This pair is tested for eq-ness +so it has to be unique. It lives in the defvar \verb|$numericFailure|. +The old value of the \verb|$BreakMode| variable is saved in a defvar +named \verb|$oldBreakMode|. + +\defdollar{numericFailure} +This is a failed union branch which is the value returned for numeric failure. +\begin{chunk}{initvars} +(defvar |$numericFailure| (cons 1 "failed")) + +\end{chunk} + +\defdollar{oldBreakMode} +\begin{chunk}{initvars} +(defvar |$oldBreakMode| nil "the old value of the $BreakMode variable") + +\end{chunk} + +\defmacro{trapNumericErrors} +The following macro evaluates form returning Union(type-of form, "failed"). +It is used in the {\tt myTrap} local function in Plot3d. +\begin{chunk}{defmacro trapNumericErrors} +(defmacro |trapNumericErrors| (form) + `(let ((|$oldBreakMode| |$BreakMode|) (|$BreakMode| '|trapNumerics|) (val)) + (declare (special |$BreakMode| |$numericFailure| |$oldBreakMode|)) + (setq val (catch '|trapNumerics| ,form)) + (if (eq val |$numericFailure|) val (cons 0 val)))) + +\end{chunk} + \section{DoubleFloatVector} Double Float Vectors are simple arrays of lisp double-floats made available at the Spad language level. Note that these vectors diff --git a/changelog b/changelog index 19cc4e6..57bf9a9 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20110220 tpd src/axiom-website/patches.html 20110220.02.tpd.patch +20110220 tpd src/interp/vmlisp.lisp move numericFailure code for plot3d +20110220 tpd books/bookvol5 move numericFailure code for plot3d +20110220 tpd books/bookvol10.3 fix algebra ++ to -- 20110220 tpd src/axiom-website/patches.html 20110220.01.tpd.patch 20110220 tpd src/interp/Makefile preload bookvol9 20110220 tpd src/interp/vmlisp.lisp treeshake compiler diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index f3e307b..21e5b7d 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3397,5 +3397,7 @@ src/axiom-website/download.html add fedora binary
books/bookvol9, bookvol5 fixup seebook xrefs
20110220.01.tpd.patch books/bookvol9 treeshake compiler
+20110220.02.tpd.patch +books/bookvol5 move numericFailure code for plot3d
diff --git a/src/interp/vmlisp.lisp.pamphlet b/src/interp/vmlisp.lisp.pamphlet index e2a9624..ba60c18 100644 --- a/src/interp/vmlisp.lisp.pamphlet +++ b/src/interp/vmlisp.lisp.pamphlet @@ -4332,28 +4332,6 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (declare (special |$BreakMode|)) (if (stringp message) (apply #'format nil message args) nil))) -;;(defmacro |trappedSpadEval| (form) form) ;;nop for now - -;; failed union branch -- value returned for numeric failure -(setq |$numericFailure| (cons 1 "failed")) - -(defvar |$oldBreakMode|) - -;; following macro evaluates form returning Union(type-of form, "failed") - -(defmacro |trapNumericErrors| (form) - `(let ((|$oldBreakMode| |$BreakMode|) - (|$BreakMode| '|trapNumerics|) - (val)) - (setq val (catch '|trapNumerics| ,form)) - (if (eq val |$numericFailure|) val - (cons 0 val)))) - -;;;;;; considering this version for kcl -;;(defmacro |trapNumericErrors| (form) -;; `(let ((val)) -;; (setq val (errorset ,form)) -;; (if (NULL val) |$numericFailure| (cons 0 (car val))))) ;; the following form embeds around the akcl error handler (eval-when