From f3c7626bda294f8f555c9e2fe46f9b6e96492705 Mon Sep 17 00:00:00 2001 From: Tim Daly Date: Sun, 5 Apr 2015 22:52:49 -0400 Subject: [PATCH] books/bookvol9 inline all error messages This is a startup test for inlining message text and removing s2-us.msgs. --- books/bookvol9.pamphlet | 141 ++++++++++++++++++++++++++++------------ changelog | 3 + patch | 9 +-- src/axiom-website/patches.html | 2 + src/doc/msgs/s2-us.msgs | 45 ------------- 5 files changed, 105 insertions(+), 95 deletions(-) diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 984c0f0..27d64f5 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -5066,7 +5066,7 @@ of the symbol being parsed. The original list read: (if (eq y '|category|) (|updateCategoryFrameForCategory| u) (|updateCategoryFrameForConstructor| u)) - (|throwKeyedMsg| 's2il0005 (list u)))) + (|throwKeyedMsg| " %1p is not a known type." (list u)))) (t value)))))) \end{chunk} @@ -7986,7 +7986,8 @@ All references to it should be removed. (rplaca (lastnode bod) (list |$elt| '$ k)) bod) (t - (|keyedSystemError| 'S2GE0016 + (|keyedSystemError| + "Unexpected error or improper call to system function %1: %2" (list "NRTputInHead" "unexpected SPADCONST form"))))) (t (|NRTputInHead| (car bod)) @@ -8075,8 +8076,9 @@ All references to it should be removed. (cond ((atom op) op) ((and (consp op) (eq (qrest op) nil)) (qfirst op)) - (t (|keyedSystemError| 'S2GE0016 - (list "mkAlistOfExplicitCategoryOps" "bad signature"))))) + (t (|keyedSystemError| + "Unexpected error or improper call to system function %1: %2" + (list "mkAlistOfExplicitCategoryOps" "bad signature"))))) (fn (op u) (if (and (consp u) (consp (qfirst u))) (if (equal (qcaar u) op) @@ -8122,7 +8124,8 @@ All references to it should be removed. (setq G167593 (cons (cons x (fn x u)) G167593)))))) ((|isCategoryForm| target |$e|) nil) (t - (|keyedSystemError| 'S2GE0016 + (|keyedSystemError| + "Unexpected error or improper call to system function %1: %2" (list "mkAlistOfExplicitCategoryOps" "bad signature"))))))) \end{chunk} @@ -8866,9 +8869,11 @@ where item has form (cond ((eq impop 'xlam) implementation) ((|member| impOp '(const |Subsumed|)) impOp) - (t (|keyedSystemError| 's2il0025 (list impop))))) + (t (|keyedSystemError| "Unexpected type of entry in domain: %1s" + (list impop))))) ((eq implementation '|mkRecord|) '|mkRecord|) - (t (|keyedSystemError| 's2il0025 (list implementation))))) + (t (|keyedSystemError| "Unexpected type of entry in domain: %1s" + (list implementation))))) (when (setq u (|assoc| (list op sig) |$functionLocations|)) (setq n (cons n (cdr u)))) (setq signatureItem @@ -9913,7 +9918,8 @@ optPackageCall. ((eq (caaar x) 'const) (cond ((equal (kar (elt yval n)) #'|Undef|) - (|keyedSystemError| 'S2GE0016 + (|keyedSystemError| + "Unexpected error or improper call to system function %1: %2" (list "optSpecialCall" "invalid constant"))) (t (mkq (elt yval n))))) ((setq fn (getl (|compileTimeBindingOf| (car (elt yval n))) '|SPADreplace|)) @@ -9944,7 +9950,7 @@ optPackageCall. (let (name) (cond ((null (setq name (bpiname u))) - (|keyedSystemError| 'S2OO0001 (list u))) + (|keyedSystemError| "Irregular slot entry: %1s" (list u))) ((eq name '|Undef|) (moan "optimiser found unknown function")) (t name)))) @@ -10441,12 +10447,14 @@ optPackageCall. ((eql len 1) (cond ((eql ind 0) (list 'qcar name)) - (t (|keyedSystemError| 'S2OO0002 (list ind))))) + (t (|keyedSystemError| "Bad index in record optimization: %1" + (list ind))))) ((eql len 2) (cond ((eql ind 0) (list 'qcar name)) ((eql ind 1) (list 'qcdr name)) - (t (|keyedSystemError| 'S2OO0002 (list ind))))) + (t (|keyedSystemError| "Bad index in record optimization: %1" + (list ind))))) (t (list 'qvelt name ind))))) \end{chunk} @@ -10471,14 +10479,15 @@ optPackageCall. ((eql len 1) (if (eql ind 0) (list 'progn (list 'rplaca name expr) (list 'qcar name)) - (|keyedSystemError| 'S2OO0002 (list ind)))) + (|keyedSystemError| "Bad index in record optimization: %1" (list ind)))) ((eql len 2) (cond ((eql ind 0) (list 'progn (list 'rplaca name expr) (list 'qcar name))) ((eql ind 1) (list 'progn (list 'rplacd name expr) (list 'qcdr name))) - (t (|keyedSystemError| 'S2OO0002 (list ind))))) + (t (|keyedSystemError| "Bad index in record optimization: %1" + (list ind))))) (t (list 'qsetvelt name ind expr))))) @@ -14896,7 +14905,8 @@ of basic objects may not be the same. (let (tp) (declare (special |$fromCoerceable$| |$Rep| |$InteractiveMode|)) (if |$InteractiveMode| - (|keyedSystemError| 'S2GE0016 + (|keyedSystemError| + "Unexpected error or improper call to system function %1: %2" (list "coerce" "function coerce called from the interpreter.")) (progn (|rplac| (cadr tt) (subst '$ |$Rep| (cadr tt) :test #'equal)) @@ -16382,7 +16392,7 @@ of the symbol being parsed. The original list read: ((and |$InteractiveMode| (null $boot)) (setq lhs (|postTran| lhs)) (if (null (identp lhs)) - (|throwkeyedmsg| 's2ip0001 nil) + (|throwkeyedmsg| "The left-hand side of a => form must be a symbol." nil) (list 'mdef lhs nil nil (|postTran| rhs)))) (t (setq lhs (|postTran| lhs)) @@ -16716,7 +16726,12 @@ of the symbol being parsed. The original list read: (setq $genno 0) (setq u (aplTran1 x)) (cond - ((containsBang u) (|throwKeyedMsg| 's2ip0002 nil)) + ((containsBang u) + (|throwKeyedMsg| + (format nil + " AXIOM cannot now process ! in the way you have used it. ~ + Use parentheses, if appropriate.") + nil)) (t u)))))) \end{chunk} @@ -20106,18 +20121,22 @@ digraph hierarchy { (t (setq signatures (cons y signatures))))) (setq name (CAR |$lisplibForm|)) (when (or noHeading signatures attributes unusedCommentLineNumbers) - (|sayKeyedMsg| 'S2CD0001 nil) + (|sayKeyedMsg| "Constructor documentation warnings (++ comments):" nil) (setq bigcnt 1) (when (or noHeading signatures attributes) - (|sayKeyedMsg| 'S2CD0002 (list (strconc (stringimage bigcnt) ".") name)) + (|sayKeyedMsg| + " %1 The constructor %2 has missing documentation." + (list (strconc (stringimage bigcnt) ".") name)) (setq bigcnt (1+ bigcnt)) (setq litcnt 1) (when noHeading - (|sayKeyedMsg| 'S2CD0003 + (|sayKeyedMsg| + " %x3 %1 The constructor %2 is missing the heading description." (list (strconc "(" (stringimage litcnt) ")") name)) (setq litcnt (1+ litcnt))) (when signatures - (|sayKeyedMsg| 'S2CD0004 + (|sayKeyedMsg| + " %x3 %1 The following functions do not have documentation:" (list (strconc "(" (stringimage litcnt) ")"))) (setq litcnt (1+ litcnt)) (loop for item in signatures @@ -20130,7 +20149,8 @@ digraph hierarchy { (list '|%x9| s) (cons '|%x9| s))))) (when attributes - (|sayKeyedMsg| 'S2CD0005 + (|sayKeyedMsg| + " %x3 %1 The following attributes do not have documentation:" (list (strconc "(" (stringimage litcnt) ")"))) (setq litcnt (1+ litcnt)) (DO ((G166491 attributes @@ -20150,7 +20170,8 @@ digraph hierarchy { (CONS '|%x9| (CONS a NIL))) ('T (CONS '|%x9| a)))))))))) (when unusedCommentLineNumbers - (|sayKeyedMsg| 'S2CD0006 + (|sayKeyedMsg| + " %1 The constructor %2 has incorrectly placed documentation." (list (strconc (stringimage bigcnt) ".") name)) (loop for item in unusedCommentLineNumbers do @@ -22997,18 +23018,25 @@ function with a list containing the full pathname as a string. (|constructor| (setq haveold t)) (|old| (setq haveold t)))) (cond - ((and havenew haveold) (|throwKeyedMsg| 's2iz0081 nil)) + ((and havenew haveold) + (|throwKeyedMsg| + (format nil "You can only specify one of the )new and )old for the ~ + )compile system command. If you give the )translate option ~ + then you cannot also give the )new option.") + nil)) (t (setq pathname (|pathname| args)) (setq pathtype (|pathnameType| pathname)) (cond ((or haveold (string= pathtype "spad")) (if (null (setq af1 ($findfile pathname '(|spad|)))) - (|throwKeyedMsg| 's2il0003 (cons (namestring pathname) nil)) + (|throwKeyedMsg| "The spad file %1 is needed but does not exist." + (cons (namestring pathname) nil)) (|compileSpad2Cmd| (list af1)))) ((string= pathtype "nrlib") (if (null (setq af1 ($findfile pathname '(|nrlib|)))) - (|throwKeyedMsg| 'S2IL0003 (cons (namestring pathname) nil)) + (|throwKeyedMsg| "The nrlib file %1 is needed but does not exist." + (cons (namestring pathname) nil)) (|compileSpadLispCmd| (list af1)))) (t (setq af1 ($findfile pathname '(|spad|))) @@ -23019,7 +23047,11 @@ function with a list containing the full pathname as a string. (setq ef (|pathname| /editfile)) (setq ef (|mergePathnames| pathname ef)) (cond - ((equal ef pathname) (|throwKeyedMsg| 's2iz0039 nil)) + ((equal ef pathname) + (|throwKeyedMsg| + (format nil "Only AXIOM source files with file extension ~ + .spad can be compiled.") + nil)) (t (setq pathname ef) (cond @@ -23030,7 +23062,10 @@ function with a list containing the full pathname as a string. (cond ((and af1 (string= (|pathnameType| af1) "spad")) (|compileSpad2Cmd| (cons af1 nil))) - (t (|throwKeyedMsg| 's2iz0039 nil))))))))))))))))) + (t (|throwKeyedMsg| + (format nil "Only AXIOM source files with file extension ~ + .spad can be compiled.") + nil))))))))))))))))) \end{chunk} @@ -23147,15 +23182,19 @@ Again we find a lot of redundant work. We finally end up calling (setq path (|pathname| args)) (cond ((not (string= (|pathnameType| path) "spad")) - (|throwKeyedMsg| 's2iz0082 nil)) + (|throwKeyedMsg| + (format nil "The old AXIOM system compiler can only compile files ~ + with file extension '.spad'.") + nil)) ((null (probe-file path)) - (|throwKeyedMsg| 's2il0003 (cons (|namestring| args) nil))) + (|throwKeyedMsg| "The file %1 is needed but does not exist." + (cons (|namestring| args) nil))) (t (setq /editfile path) (|updateSourceFiles| path) (|sayKeyedMsg| (format nil "Compiling AXIOM source code from ~ - file %1b using old system compiler.") + file %1 using old system compiler.") (list (|namestring| args))) (setq optlist '(|break| |constructor| |functions| |library| |lisp| |new| |old| |nobreak| |nolibrary| |noquiet| |vartrace| |quiet| @@ -23177,25 +23216,34 @@ Again we find a lot of redundant work. We finally end up calling (|nobreak| (setq |$scanIfTrue| t)) (|break| (setq |$scanIfTrue| nil)) (|vartrace| (setq |$QuickLet| nil)) - (|lisp| (|throwKeyedMsg| 's2iz0036 (list ")lisp"))) + (|lisp| + (|throwKeyedMsg| + "%1 is an unknown or unavailable for the )compile command." + (list ")lisp"))) (|functions| (if (null optargs) - (|throwKeyedMsg| 's2iz0037 (list ")functions")) + (|throwKeyedMsg| "%1 requires and argument and you do not give one." + (list ")functions")) (setq |$compileOnlyCertainItems| optargs))) (|constructor| (if (null optargs) - (|throwKeyedMsg| 's2iz0037 (list ")constructor")) + (|throwKeyedMsg| "%1 requires and argument and you do not give one." + (list ")constructor")) (progn (setelt fun 0 '|c|) (setq constructor (mapcar #'|unabbrev| optargs))))) (t - (|throwKeyedMsg| 's2iz0036 + (|throwKeyedMsg| + "%1 is an unknown or unavailable for the )compile command." (list (strconc ")" (|object2String| optname))))))) (setq |$InteractiveMode| nil) (cond (|$compileOnlyCertainItems| (if (null constructor) - (|sayKeyedMsg| 's2iz0040 nil) + (|sayKeyedMsg| + (format nil "The )constructor option to )compile must also be ~ + specified when the )functions option is used.") + nil) (|compilerDoitWithScreenedLisplib| constructor fun))) (t (|compilerDoit| constructor fun))) (|extendLocalLibdb| |$newConlist|) @@ -23228,7 +23276,8 @@ Again we find a lot of redundant work. We finally end up calling (setq path (|pathname| (|fnameMake| (car args) "code" "lsp"))) (cond ((null (probe-file path)) - (|throwKeyedMsg| 's2il0003 (cons (|namestring| args) nil))) + (|throwKeyedMsg| "The file %1 is needed but does not exist." + (cons (|namestring| args) nil))) (t (setq optlist '(|quiet| |noquiet| |library| |nolibrary|)) (setq beQuiet nil) @@ -23242,7 +23291,8 @@ Again we find a lot of redundant work. We finally end up calling (|library| (setq dolibrary t)) (|nolibrary| (setq dolibrary nil)) (t - (|throwKeyedMsg| 's2iz0036 + (|throwKeyedMsg| + "%1 is an unknown or unavailable for the )compile command." (list (strconc ")" (|object2String| optname))))))) (setq lsp (|fnameMake| @@ -23251,15 +23301,21 @@ Again we find a lot of redundant work. We finally end up calling (|pathnameType| path))) (cond ((|fnameReadable?| lsp) - (unless beQuiet (|sayKeyedMsg| 's2iz0089 (list (|namestring| lsp)))) + (unless beQuiet + (|sayKeyedMsg| "Compiling Lisp source code from file %1" + (list (|namestring| lsp)))) (recompile-lib-file-if-necessary lsp)) (t - (|sayKeyedMsg| 's2il0003 (list (|namestring| lsp))))) + (|sayKeyedMsg| "The file %1 is needed but does not exist." + (list (|namestring| lsp))))) (cond (dolibrary - (unless beQuiet (|sayKeyedMsg| 's2iz0090 (list (|pathnameName| path)))) + (unless beQuiet (|sayKeyedMsg| "Issuing )library command for %1" + (list (|pathnameName| path)))) (localdatabase (list (|pathnameName| (car args))) nil)) - ((null beQuiet) (|sayKeyedMsg| 's2iz0084 nil)) + ((null beQuiet) + (|sayKeyedMsg| + "The )library system command was not called after compilation." nil)) (t nil)) (|terminateSystemCommand|) (|spadPrompt|))))) @@ -25292,7 +25348,8 @@ but there is no handler listed for the form (See \ref{handlers}). (setq sig (cdar modemap)) (cond ((not (eql (|#| dc) (|#| sig))) - (|keyedSystemError| 'S2GE0016 + (|keyedSystemError| + "Unexpected error or improper call to system function %1: %2" (list "substituteIntoFunctorModemap" "Incompatible maps"))) ((equal (|#| argl) (|#| (cdr sig))) (setq sig (eqsubstlist argl (cdr dc) sig)) diff --git a/changelog b/changelog index c1742a7..daf3ec1 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20150405 tpd src/axiom-website/patches.html 20150405.02.tpd.patch +20150405 tpd src/doc/s2-us.msgs inline of message text +20150405 tpd books/bookvol9 inline all error messages 20150405 tpd src/axiom-website/patches.html 20150405.01.tpd.patch 20150405 tpd src/interp/i-analy.lisp fix use of string as msg key 20150405 tpd books/bookvol9 example compiler code with string messages diff --git a/patch b/patch index 90d26a8..a1651f2 100644 --- a/patch +++ b/patch @@ -1,14 +1,7 @@ -src/doc/s2-us.msgs start inline of message text +books/bookvol9 inline all error messages This is a startup test for inlining message text and removing s2-us.msgs. -The s2-us.msgs was intended to allow error messages to be internationalized. -NAG did not use this mechanism. Recent discussions makes it obvious that -this mechanism is never going to be used so this effort will remove it. - -A call to fetchKeyedMsg now accepts a string directly. -A test case for the compiler is included (bookvol9). -A fix to i-analy which used strings for the key is included. diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 1f2d925..37c6956 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -5000,6 +5000,8 @@ books/bookvol5 rewrite code into better form
books/bookvol5 remove getKeyedMsg function
20150405.01.tpd.patch src/doc/s2-us.msgs start inline of message text
+20150405.02.tpd.patch +books/bookvol9 inline all error messages
diff --git a/src/doc/msgs/s2-us.msgs b/src/doc/msgs/s2-us.msgs index 030e75d..c5c6135 100755 --- a/src/doc/msgs/s2-us.msgs +++ b/src/doc/msgs/s2-us.msgs @@ -1,17 +1,5 @@ **Copyright (c) The Numerical Algorithms Group Limited 1992-1994. All Rights Reserved. -S2CD0001 - %b Constructor documentation warnings (++ comments): %d -S2CD0002 - %1 The constructor %2b has missing documentation. -S2CD0003 - %x3 %1 The constructor %2b is missing the heading description. -S2CD0004 - %x3 %1 The following functions do not have documentation: -S2CD0005 - %x3 %1 The following attributes do not have documentation: -S2CD0006 - %1 The constructor %2b has incorrectly placed documentation. S2IA0001 Division by zero on conversion to GaloisField. S2IB0001 @@ -287,8 +275,6 @@ S2IL0003 The file %1b is needed but does not exist. S2IL0004 The source file for %1b cannot be located. -S2IL0005 - %1bp is not a known type. S2IL0006 Abbreviations must have 8 or fewer characters and should be uppercase. S2IL0007 @@ -335,8 +321,6 @@ S2IL0023A The operation %1b with type %2b is not implemented domain %3bp . S2IL0024A The operation %1b with type %2b does not exist in domain %3bp . -S2IL0025 - Unexpected type of entry in domain: %1s S2IL0026 Cannot locate operation alist for constructor %1b S2IL0027 @@ -403,9 +387,6 @@ S2IM0027 you supplied %1b for rule %2b S2IP0001 The left-hand side of a %b => %d form must be a symbol. -S2IP0002 - AXIOM cannot now process %b ! %d in the way you have used it. - Use parentheses, if appropriate. S2IP0003 Argument number %1b of %2bp must have type %3bp . S2IP0004 @@ -755,19 +736,10 @@ S2IZ0034 S2IZ0035 The file %1b will not be added to the list of working source files because the file does not exist. -S2IZ0036 - %1b is an unknown or unavailable for the %b )compile %d command. -S2IZ0037 - %1b requires and argument and you do not give one. S2IZ0038A Compiling AXIOM source code from file %1b using AXIOM-XL compiler and options %b %ceon %2 %ceoff %d Use the system command %b )set compiler args %d to change these options. -S2IZ0039 - Only AXIOM source files with file extension .spad can be compiled. -S2IZ0040 - The %b )constructor %d option to %b )compile %d must also be - specified when the %b )functions %d option is used. S2IZ0041 It is not known what %1bp is, so no information about it can be displayed. @@ -1001,18 +973,9 @@ S2IZ0079 AXIOM cannot import %1b from frame %2b because it cannot be found. S2IZ0080 Unknown system command: %1b -S2IZ0081 - You can only specify one of the %b )new %d and %b )old %d for the - %b )compile %d system command. If you give the %b )translate %d option - then you cannot also give the %b )new %d option. -S2IZ0082 - The old AXIOM system compiler can only compile files with file extension - ".spad". S2IZ0083 The AXIOM-XL compiler cannot compile files with file extensions ".as" or ".ao". -S2IZ0084 - The )library system command was not called after compilation. S2IZ0085 Warning: translation of an old-style source code ".spad" file to a new-style ".as" file changes the old system compiler. If you wish to use the old @@ -1025,10 +988,6 @@ S2IZ0087 ".spad" file to ".as" file. S2IZ0088 Creating output file with name %b %1 %d . -S2IZ0089 - Compiling Lisp source code from file %1 -S2IZ0090 - Issuing )library command for %1 S2GE0000 Internal Error S2GE0001 @@ -1159,10 +1118,6 @@ S2NR0003 Error while instantiating type %1b S2NR0004 Cannot find domain in template: %1s -S2OO0001 - Irregular slot entry: %1s -S2OO0002 - Bad index in record optimization: %1b S2OR0001 Category or domain %1b not known. S2OR0002 -- 1.7.5.4