Questions tagged [upvalues]
The upvalues tag has no summary.
82 questions
1
vote
0
answers
63
views
Volume[Octahedron]^=1 adds Protected attribute back to unprotected Octahedron [duplicate]
In memory of my whole night.
I encountered this when trying to answer this question by fixing the old Geometry`Polytopes` Legacy Standard Add-On Package.
Consider ...
2
votes
0
answers
82
views
Is there a symbol or construct that when passed as argument returns the caller?
Like Identity when passed an argument it returns that argument.
Identity[x]
gives
x
Is there a similar symbol or construct <...
5
votes
1
answer
219
views
NumericQ evaluates to False at first, but then evaluates to True once I copy and paste the same input
After some struggling, this is my current minimal working example:
...
0
votes
0
answers
44
views
Defining multilinear function series expansion
I want to define an abstract multilinear function mlfunc in arbitrary arguments with the standard algebraic and analytic properties.
Implementing algebraic ...
0
votes
0
answers
81
views
How to make an UpValue about Message for Protected symbol?
I would like to intercept certain messages, like the following
...
2
votes
1
answer
114
views
Why can't I assign upvalues to NonCommutativeMultiply?
I'm trying to define a non-commutative product with respect to which, certain quantities (e.g. numbers, and some other quantities defined in my code) behave as "scalars" and can be pulled ...
3
votes
1
answer
218
views
Pattern matching vs. condition in a function
I'm trying to learn stuff from pattern matching but I found sometimes pattern matching does not work as I expected. Could anyone explain why the below outputs are not same? Thank you.
And could anyone ...
3
votes
3
answers
179
views
Can't get TagSetDelayed to match LHS when the latter has a Hold attribute set
I'm following this example here;
Code Readability and Object-Oriented Code
...
4
votes
1
answer
180
views
Can UpValues (as well as other "*Values") always be converted to DownValues?
As this post has discussed, UpValues are certainly useful, and as this post has discussed, g /: f[g[x_]] := h[x] is not ...
1
vote
0
answers
89
views
Overloading the Normal function
I am currently working on library that keeps functions in unevaluated form, e.g.
In: a = RhoVariable[s]
Out: RhoVariable[s]
RhoVariable has some definition, namely ...
1
vote
1
answer
90
views
How to clear a selection of definitions from UpValues?
I'm trying to set up a bunch of 2D points using UpSet that I am going to use later for building lines and graphs.
...
18
votes
1
answer
529
views
Broken ValueQ function in Mma12.2?
f[x] ^= 1;
ValueQ[g[x]]
returns True in Mathematica 12.2. Is it a bug?
1
vote
1
answer
119
views
Define a function for symbols with UpValues
Suppose that we define UpValues for different symbols
isSpecialFunction[N1]^=True
isSpecialFunction[N2]^=True
isSpecialFunction[N3]^=True
I would like to make the ...
5
votes
1
answer
69
views
How to duplicate UpValue of one function to another?
Let's say I have defined a function zO for the following up-values
...
3
votes
1
answer
156
views
What are some ways to overload Min in order for it to work with user defined expressions?
I have defined size to work with discrete size labels:
...