Linked Questions
17 questions linked to/from Copying one symbol into another
1
vote
0answers
48 views
Define a second name for a function [duplicate]
I'm working with an own package of functions. During development I noticed, that my naming scheme is not that clever; for example some of my functions are starting with capital letters. But I have ...
476
votes
37answers
109k views
What are the most common pitfalls awaiting new users?
As you may already know, Mathematica is a wonderful piece of software.
However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...
23
votes
4answers
997 views
Making a symbol's new definitions be tried before all previously defined ones
Is there any way to "close" a package (or a symbol, or a context) in that if a user of the package adds definitions to the symbol they will be tried before the package defined ones, just like what ...
24
votes
4answers
1k views
Permanently extending the behaviour of functions (like decorators)
Suppose I have a function, e.g.
f[x_] := x^2
It works like this:
f[5]
(* 25 *)
I would like to permanently modify it so ...
22
votes
2answers
2k views
Does Set vs. SetDelayed have any effect after the definition was done?
I was always assuming that the only difference between Set (=) and SetDelayed (...
12
votes
1answer
561 views
Triggering actions when a variable is set
Some built-in variables trigger actions when their values are changed:
...
5
votes
3answers
168 views
Why does `Block` reset `Attributes`?
Not even "formal symbols" such as \[FormalX] are guaranteed to always be symbolic. Their Protected argument is forgotten when ...
15
votes
1answer
238 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 ...
11
votes
1answer
245 views
Copy Built-in function to new name
It is know that some built-in functions are system function and changing their properties may cause trouble.
Suppose for example I want to change features of Cases:
...
12
votes
2answers
264 views
Why is a symbol still found after changing its context?
It seems that we can change the context of symbols:
In[1]:= x = 1
Out[1]= 1
In[2]:= Context[x] = "foo`";
But then x is still ...
-4
votes
1answer
826 views
Creating new functions using the names of existing ones
I have a list of functions
{G[x_, y_], F[x_, y_], C[x_, y_]}
how I can create the list of new functions such as
...
4
votes
2answers
218 views
Wrongly assigning a value to an expression
Sometimes I misstype an equality and I write an assignment instead.
For example, if I write
f'[x] = 2
instead of an equation, ...
4
votes
2answers
264 views
Stopping a head from evaluating more than once
While attempting to answer my own question, Is there a way to "hold" prefix / infix / postfix notation?, I came across the need to evaluate a recursive function only one level deep.
For ...
4
votes
1answer
204 views
Copying a symbol using a subpackage
In this question, there is a beautiful method to copy a symbol. However, i'm not able to use it as an addon to my package. So the main question is
How to rename/copy a function defined in a package ...
2
votes
1answer
399 views
Transfer of symbols between contexts
As many others (I guess) I'm struggling with the handling of contexts within Mathematica. I'm working on a new package definition with the usual syntaxt specified by the Mathematica documentation:
<...