From daa5e774b0adf76484b85c4b0b1851663467ae89 Mon Sep 17 00:00:00 2001 From: Tim Daly Date: Sun, 5 Apr 2015 20:11:17 -0400 Subject: [PATCH] src/doc/s2-us.msgs start inline of message text 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. --- books/bookvol5.pamphlet | 13 ++++++++----- books/bookvol9.pamphlet | 5 ++++- changelog | 5 +++++ patch | 13 +++++++++++-- src/axiom-website/patches.html | 2 ++ src/doc/msgs/s2-us.msgs | 2 -- src/interp/i-analy.lisp.pamphlet | 8 ++++---- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 1d00dbe..ed1fb5b 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -995,11 +995,14 @@ to fill the table, otherwise we do a key lookup in the hash table. \begin{chunk}{defun fetchKeyedMsg} (defun |fetchKeyedMsg| (key ignore) (declare (ignore ignore) (special *msghash* |$defaultMsgDatabaseName|)) - (setq key (|object2Identifier| key)) - (unless *msghash* - (setq *msghash* (make-hash-table)) - (cacheKeyedMsg |$defaultMsgDatabaseName|)) - (gethash key *msghash*)) + (if (not (stringp key)) + (progn + (setq key (|object2Identifier| key)) + (unless *msghash* + (setq *msghash* (make-hash-table)) + (cacheKeyedMsg |$defaultMsgDatabaseName|)) + (gethash key *msghash*)) + key)) \end{chunk} diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 3865d62..984c0f0 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -23153,7 +23153,10 @@ Again we find a lot of redundant work. We finally end up calling (t (setq /editfile path) (|updateSourceFiles| path) - (|sayKeyedMsg| 's2iz0038 (list (|namestring| args))) + (|sayKeyedMsg| + (format nil "Compiling AXIOM source code from ~ + file %1b using old system compiler.") + (list (|namestring| args))) (setq optlist '(|break| |constructor| |functions| |library| |lisp| |new| |old| |nobreak| |nolibrary| |noquiet| |vartrace| |quiet| |translate|)) diff --git a/changelog b/changelog index 5f77de9..c1742a7 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,8 @@ +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 +20150405 tpd books/bookvol5 fetchKeyedMsg accepts strings +20150405 tpd src/doc/s2-us.msgs start inline of message text 20150403 tpd src/axiom-website/patches.html 20150403.01.tpd.patch 20150403 tpd books/bookvol5 remove getKeyedMsg function 20150227 tpd src/axiom-website/patches.html 20150227.02.tpd.patch diff --git a/patch b/patch index 999b608..90d26a8 100644 --- a/patch +++ b/patch @@ -1,5 +1,14 @@ -books/bookvol5 remove getKeyedMsg function +src/doc/s2-us.msgs start inline of message text + +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. -This is rewritten as calls to fetchKeyedMsg diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index ffee40d..1f2d925 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -4998,6 +4998,8 @@ books/bookvol5 fix syntax errors
books/bookvol5 rewrite code into better form
20150403.01.tpd.patch books/bookvol5 remove getKeyedMsg function
+20150405.01.tpd.patch +src/doc/s2-us.msgs start inline of message text
diff --git a/src/doc/msgs/s2-us.msgs b/src/doc/msgs/s2-us.msgs index 482e49d..030e75d 100755 --- a/src/doc/msgs/s2-us.msgs +++ b/src/doc/msgs/s2-us.msgs @@ -759,8 +759,6 @@ S2IZ0036 %1b is an unknown or unavailable for the %b )compile %d command. S2IZ0037 %1b requires and argument and you do not give one. -S2IZ0038 - Compiling AXIOM source code from file %1b using old system compiler. S2IZ0038A Compiling AXIOM source code from file %1b using AXIOM-XL compiler and options %b %ceon %2 %ceoff %d diff --git a/src/interp/i-analy.lisp.pamphlet b/src/interp/i-analy.lisp.pamphlet index 7c4bc80..6d29702 100644 --- a/src/interp/i-analy.lisp.pamphlet +++ b/src/interp/i-analy.lisp.pamphlet @@ -1022,7 +1022,7 @@ (SPADLET |ms| (|bottomUp| |pred|)) (COND ((NEQUAL |$Boolean| (CAR |ms|)) - (|throwKeyedMsg| "S2IB0001" (CONS |name| NIL))) + (|throwKeyedMsg| 'S2IB0001 (CONS |name| NIL))) ('T |ms|)))))) ;bottomUpCompilePredicate(pred, name) == @@ -1074,7 +1074,7 @@ (COND ((SPADLET |m| (|isType| |t|)) (|bottomUpType| |t| |m|)) ((EQ |id| '|noMapVal|) - (|throwKeyedMsg| "S2IB0002" NIL)) + (|throwKeyedMsg| 'S2IB0002 NIL)) ((EQ |id| '|noBranch|) (|keyedSystemError| 'S2GE0016 (CONS "bottomUpIdentifier" @@ -1185,7 +1185,7 @@ ((SPADLET |m| (|getMode| |t|)) (COND ((AND (CONSP |m|) (EQ (QCAR |m|) '|Mapping|)) - (|throwKeyedMsg| "S2IB0003" + (|throwKeyedMsg| 'S2IB0003 (CONS (|getUnname| |t|) NIL))) ('T (COND @@ -1209,7 +1209,7 @@ |m|))) (|putValue| |t| |val|) (CONS |m| NIL)) ('T - (|throwKeyedMsg| "S2IB0004" (CONS |id| (CONS |m| NIL)))))))) + (|throwKeyedMsg| 'S2IB0004 (CONS |id| (CONS |m| NIL)))))))) ('T (SPADLET |val| (mkObjWrap |id| |defaultMode|)) (COND ((OR (NULL |target|) (BOOT-EQUAL |defaultMode| |target|)) -- 1.7.5.4