Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [symbols]

Mathematica symbols are the ultimate atoms of symbolic data. Every symbol has a unique name, exists in a certain Mathematica context or namespace, and can have a variety of types of values and attributes.

Filter by
Sorted by
Tagged with
87
votes
6answers
85k views

How do I clear all user defined symbols?

Is there some way to do this other than going to Evaluation -> Quit kernel and firing a new one up?
73
votes
2answers
7k views

Is there a way to separate variables between multiple notebooks?

I often correct homework by checking the calculations in Mathematica. Sometimes you would like to have two solutions open at once. However often defined symbols such as ...
50
votes
4answers
3k views

Is there an equivalent of MATLAB's Workspace window in Mathematica?

For example, in MATLAB, a panel is available where one can see straightaway which variables are used and their dimension sizes. Is such a feature available in Mathematica? I really find it hard to ...
44
votes
5answers
3k views

How to create symbols from strings and set values for them?

I am trying to convert a list of string names into symbols, which will then be used to store data. I have 24 files (where the name of each file is a member of the list mentioned above) that I need to ...
44
votes
1answer
2k views

Local variables in Module leak into the Global context

From the Mathematica documentation on Module: Module allows you to set up local variables with names that are local to the module. But after using ...
40
votes
1answer
2k views

What is the story with Removed symbols?

The system function Remove evidently exists primarily to turn a fatal problem into an annoying one, by giving the user a (rather blunt) instrument with which to ...
33
votes
5answers
2k views

Does every Symbol in Mathematica induce a monad?

From my question about types in Mathematica, I assume that every Symbol in Mathematica is a type if it appears as a Head of some ...
32
votes
3answers
13k views

Guidelines on giving readable names to variables [closed]

I know that one cannot use underscore to a variable name, like degree_of_The_First_Polynomial. But for a long variable name, it ...
32
votes
2answers
2k views

How can I use the Klingon alphabet symbols?

Note: This functionality is presently missing. See: How to add named characters to Mathematica 10? Mathematica apparently supports the Klingon alphabet: ...
31
votes
5answers
3k views

How do I reassign canonical ordering of symbols?

I have a big polynomial that evaluates to: $$A^2 e^2 \phi ^- \phi ^++A e \phi ^- \phi ^+ c_{2 w} g_Z+\frac{1}{2} A e g h W^- \phi ^+ +\ll13\gg,$$ which is supposed to represent some terms in the ...
31
votes
3answers
683 views

Why does removing a function and defining it on the same line not work?

Why do the two pieces of code below yield rather different results? The only difference is that in the first one the function definition is in the same line as the ...
30
votes
2answers
1k views

How to make Mathematica variables declarative instead of just-in-time?

Is there a way to have Mathematica at the notebook level (SetOptions[EvaluationNotebook[], CellContext -> Notebook]) only uses a set of declared variables in the ...
28
votes
5answers
2k views

What are the requirements for a well behaved indexed variable? Subscript, ToExpression, Downvalue?

On writing this answer I needed to call a function, (NonlinearModelFit) with an unknown number of parameters. We have learned that we should not use ...
27
votes
4answers
2k views

How can I adaptively simplify a curved shape?

For the purposes of creating a publication-quality plot marker I wish to convert a font glyph into a simplified Polygon where points are taken adaptively according ...
27
votes
1answer
495 views

Are greek symbols causing different evaluation?

I've updated today to Mathematica 9.0.1.0 from version 8 and found something that absolutely confuses me. Let us define a piecewise function: ...
25
votes
5answers
5k views

How to pass a symbol name to a function with any of the Hold attributes?

Given a function with the attribute HoldFirst, HoldAll or similar, and a variable, list, how ...
20
votes
6answers
4k views

How to clear all variables except one?

I have a lot of variables: $a,b,c,d, \ldots $ I want to clear the values of all of them except $b$. It's really lengthy to write Clear[a]; Clear[c]; ... Is ...
19
votes
2answers
840 views

Automated testing for compatibility with older Mathematica versions

I have several packages which I actively develop and maintain. I try to stay up to date with new releases of Mathematica and usually update within a couple of months of a new version coming out. As a ...
18
votes
4answers
1k views

How can I randomly generate a unique, unused symbol?

In a previous question on collecting terms for a multivariable polynomial, I answered with a solution that required a unused symbol to be used for a temporary substitution and back substitution. It ...
18
votes
3answers
377 views

How can I test properties of a symbol from the string name without the symbol completely evaluating

Suppose I have a few symbols, one of which has a value: {abc1, abc2 = 5, abc3}; I can use Names to get the list of names, as ...
18
votes
2answers
299 views

How to find the package file that stores a certain symbol?

Is it possible to figure out in what file a certain packaged symbol lives in (assuming there is no shadowing between multiple identical symbol names)? I would like to have a function that if, given a ...
17
votes
1answer
1k views

Get the name of a symbol passed to a function

I'm trying to get the name of a symbol passed to a function with this: f[x_] := {SymbolName[x], x} SetAttributes[f, HoldFirst] x = 5; f[x] But ...
16
votes
3answers
867 views

Defining symbol shortcuts in the Front End

I was wondering (because I could not find any documentation on this) if it is possible to do shorthand abbreviations for domains or could one define them? E.g. In[1]:= Element[p,Complexes] Out[1]...
16
votes
2answers
3k views

How to unload automatically loaded packages?

I know that this has been discussed here (How do I clear all user defined symbols?), but my case is somewhat different. How does one unload packages during runtime that were loaded with the start of ...
15
votes
2answers
431 views

Why does leaving and re-entering a context lose values defined in that context?

I'm getting unexpected behavior when beginning a new context, leaving it, and then re-entering it. Specifically, when re-entering the context, symbols that had been previously defined in that context ...
15
votes
1answer
485 views

Is the sharing of variables in Module/Block within Compile documented behavior?

Today I noticed something, I think for the first time. When used inside Compile variable values within Module (and ...
15
votes
1answer
222 views

All value types for a symbol?

Robby Villegas here shows a nice way to see all the types associated with a symbol. He sets a symbol, valueTypes, to an explicit list of the values types in ...
14
votes
3answers
672 views
14
votes
1answer
7k views

How to create symbol whose name has subscript?

I can do Symbol["foobar"] to create a symbol foobar. How to create a symbol $\theta_1$? ...
13
votes
2answers
2k views

Which Mathematica function has the longest name (by character length?)

I came across DamerauLevenshteinDistance[u,v] in the documentation center so that got me thinking: Which documented Mathematica function has the longest name? ...
13
votes
1answer
548 views

How can I obtain a complete list of the kinds of atomic expressions in the Wolfram Language using only the language itself?

I mean, Wolfram is a language--it's words are infinitely combinable. According to answers to my last question, the only way I can find out if an expression is atomic is actually use the expression. ...
13
votes
1answer
156 views

How to remove a LocalSymbol (or CloudSymbol)?

In version 10.2 LocalSymbol can be used to create a persistent store of a variable. Once this is created I don't see a method to remove it. How are are they ...
13
votes
1answer
141 views

SetDelayed::wrsym on first use of \[FormalX] in Plot & ContourPlot

Bug introduced in 11.1 or earlier and persisting through 11.3.0 or later CASE:4024964 Here's a weird one. Starting with a fresh kernel, the first time I plot a function of ...
13
votes
1answer
365 views

Is garbage collection broken in version 10.0.0?

Bug introduced in 10.0.0 and fixed in 10.0.1 In version 10.0.0 under Windows I am observing the following behavior: ...
12
votes
3answers
2k views

Telling mathematica to output * instead of space for multiplication, so I can copy as plain text

I am trying to get some symbolic expressions in Mathematica which I would like to paste into my C/MATLAB codes. This can be accomplished nicely by selecting the expression and right-clicking to ...
12
votes
2answers
174 views

Bug: With[] pattern-variable renaming misses symbols within `Except`

Bug introduced in 10.1 and fixed in 11.1 Thank you for taking the time to send in this report. It does appear that pattern-variable renaming misses symbols within Except when using With. I will ...
12
votes
1answer
186 views

Check if symbol is in core language

How can I check if a symbol is pre-defined by Mathematica, in a way that's backwards compatible with old versions? i.e. I would like some CoreLanguageQ[x_Symbol] ...
11
votes
2answers
2k views

Why did Mathematica choose brackets for function arguments over parentheses?

This is a non-technical question. I'm just curious why Mathematica breaks the convention that parentheses are widely used for function arguments. What's the advantage of ...
11
votes
3answers
972 views

List of Mathematica glyphs

Context I am using Mathematica to create live documents - documents that are both interactive and show mathematical derivations. Now, I'm aware that there are certain symbols that are available via: ...
11
votes
3answers
556 views

How to set a TraditionalForm output for a symbol

How do I set a TraditionalForm output for a particular symbol/function? In particular I would like my user-defined symbol ...
11
votes
1answer
219 views

How can I define symbols but not have them show up in the front end?

I have a huge set of packages with, arguably, far too many functions. Paring down the number of functions, while a good thing to do eventually, is something I just don't want to spend the time on ...
10
votes
2answers
564 views

Make symbols atomic, without losing their type

So, I'd like to define a matrix M, that does not decompose into it's constituents when I do things like Tr[M], but I also want it's type to be retained. (By type, ...
10
votes
1answer
324 views

Defining my own invisible operator

There are some invisible operators in Mathematica (\[ImplicitPlus],\[InvisibleTimes],...
10
votes
0answers
280 views

The introduction for Context in Wagner's book is out of date? [duplicate]

In Section 8.1.1 (P230 of the book, P249 of the PDF) of Wagner's book, the following example is shown: x = 5; temp`x = 6; Begin["temp`"]; {x, Global`x} The ...
9
votes
2answers
2k views

Character to replace _ in symbol names?

In C, _ comes in handy when naming variables and functions, as a replacement for space. For example: ...
9
votes
2answers
295 views

Naming convention for symbols exported from package

I know this is a little opinion based, but so is Mathematica style guide and similar topics. The issue is important so I think this topic will be beneficial for future visitors. Q: So ...
9
votes
1answer
894 views

How can I replace the Greek symbols in an expression with their plain text names?

Suppose I have an expression with Greek symbols in it. How would I convert that expression to another expression where the Greek symbols have been replaces with their names in plain text? I've ...
9
votes
1answer
1k views

How to properly DumpSave & Get Global`s symbols inside packages while not touching Global context?

For efficiency reasons I prefer to use DumpSave instead of Save. For ease of access I prefer to save symbols in ...
9
votes
1answer
197 views

1 is not the SameQ as Null, but why might 1 be Equal to Null?

The command SameQ[1, Null] returns False which is what I would expect, but the command ...
9
votes
1answer
155 views

What is ExpectationE and what does it do?

I just found the symbol ExpectationE with autocomplete. Rendered the symbol is Searching the documentation and the internet leads to nothing. Does somebody know ...