Message Boards Message Boards

0
|
3898 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to create a function that calls Symbolize from the Notation package

Posted 11 years ago

Hello,

I use Symbolize from the notation package to symbolize some expressions. When calling Symbolize twice it can happen that the same expression is not the same symbol anymore. Is there a way to create a function that first checks whether an expression has already been symbolized before doing so.

My current Idea is doing something like this:

IsNotSymbolized[symbol_] := 
 If[StringCount[ToString[FullForm[symbol]], "UnderBracket"] > 0 || 
   NumericQ[symbol] || VectorQ[symbol] || MatrixQ[symbol] || 
   ArrayQ[symbol] || StringQ[symbol],
  False,
  True
  ]

Which is then use like this:

If[IsNotSymbolized[Subscript[S, R]], Symbolize[
ParsedBoxWrapper[
SubscriptBox["S", "R"]]], "Already Symbolized"]

Which actually looks like this:

enter image description here

I would like to put all this in one function that symbolizes if it hasn't been already.

Kind Regards, Mathias Breuss

POSTED BY: Mathias Breuss
Posted 11 years ago

the missing image: enter image description here

POSTED BY: Mathias Breuss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract