Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 186

General::tag weird behavior

$
0
0

Is there anyone here who can explain this strange behavior? Consider the following code:

ClearAll[f]General::generaltag = "This is a general message";f::fspecifictag = "This is a f-specific message";

Then

General::generaltagf::generaltagf::fspecifictag

evaluates to

enter image description here

While the Message function works as expected despite the unevaluated middle expression,

Message[General::generaltag]Message[f::generaltag]Message[f::fspecifictag]

yielding

enter image description here

StringForm fails on the middle expression and ends up with

enter image description here

However, repeating definition of the General message name without prior ClearAll,

General::generaltag = "This is a general message";

will fix everything, giving for both

General::generaltagf::generaltagf::fspecifictag

and

StringForm[General::generaltag]StringForm[f::generaltag]StringForm[f::fspecifictag]

enter image description here

(the Message behavior remains unchanged). Reusing the the very first code with ClearAll would bring everything back to the original situation.

I appreciate any advice or tips.


Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>