# Tagged Questions

The tag has no wiki summary.

23 views

### Upvalues and order of interpretation

I'm trying to use UpValues to improve the usability of some code, but I am running into an issue where the order of the UpValues is important, and I am not sure if it is my understanding or a ...
64 views

### How to assign up-values for Derivative?

I have defined several custom analytic functions. Here is the simplest example: ln[x_, a_?NumericQ] := Piecewise[{{Log[x], Re[a] > 0}, {-Log[1/x], True}}] ...
62 views

### Changing a tag when one function is passed into another using UpValues

I have two complicated functions f[x,y] and g[t]. Before the main evaluation code in ...
220 views

### Why isn't Lookup treated like other symbols?

With Mathematica 10, I wanted to overload Lookup using TagSetDelayed, but it doesn't work. For instance, if I define two objects ...
106 views

### Strange behaviour of UpSet [duplicate]

Can anyone explain what is going on here? I want to modify TensorRank for IdentityMatrix, but it fails on its first attempt: ...
79 views

### Can a Symbol own OwnValues that don't evaluate when it's the head of an expression?

I believe this a question that most of us have encountered when we were beginners but forgot when we got more familiar with Mathematica. We know the notation $y=y(x)$ for functions, where $y$ here ...
3k views

### How to force 2+2=5

I was looking at this question (writing a program such that 2 + 2 = 5) and tried to write something in Mathematica, but I couldn't get something to work without completely replacing ...
125 views

### Inheritance in Mathematica using pattern matching on UpValues

Edit: I think in my original post, I missed emphasizing the main point. This is mainly a pattern matching question. If you're interested in the 'why' of this question, please read the original post ...
155 views

### How to customize derivative behavior via upvalues?

I'm having trouble getting customized derivatives (defined using upvalues) to behave in sane ways. By this I mean that I'd like to define a derivative using an upvalue and then have Mathematica apply ...
87 views

I have some objects that I want to present in TeXForm. Thus, it is easily to do as follows: YoungTableau/:TeXForm[YoungTableau[diagram_]] However, what if I ...
174 views

### Make Sinc'[0] return 0 instead of Indeterminate

I want Sinc'[0] to return 0, but instead it returns Indeterminate. I've tried Unprotect[Sinc] Unprotect[Derivative] Derivative[1][Sinc][0] ^= 0 But it doesn't ...
86 views

### Experiment with TagSetDelayed involving Part

Reading Associating Definitions With Different Symbols, I was intrigued by this: You can think of upvalues as a way to implement certain aspects of object-oriented programming. A symbol like ...
76 views

### How do I use a passed-in symbol as a tag to define UpValues?

ClearAll@foo; foo[tag_] := ( tag /: tag[i_] := tag[[i]] ); a = {7, 8, 9}; foo[a]; a[2] I wanted the above to output 8, ...
95 views

### Why is held expression evaluated?

Context: I'm studying non-linear dynamics. As part of a bigger problem, I'd like to generate lists of the form {{deq, ic1}, {deq, ic2}, ...}, where ...
238 views

I trying to modify the behaviour of the built-in Conjugate[] operator on a particular function I have defined, to take into account that some of its variables are ...
177 views

### Access curated or locally stored data with curated data functions?

Say I have a toy package, something like: ...
332 views

### Copying one symbol into another

I would like to know how can I completely copy one Symbol to another. When I say copy, a refer to UpValues, DownValues, ...
104 views

### UpValues evaluation with Dot operator

I would like to simplify some database notation, and I'm doing some tests with UpValues for that. For example, if I set this Upvalue fot tab1: ...
342 views

### Upvalues, TagSet and UpSet, what's the difference, when should a use each?

Some of the big mysteries of Universe Mathematica for me is the application of UpValues. I know about this question and know the very poor Mathematica documentation on that. I'm very curious to know ...
154 views

### How to define UpValues in a different context from within a package

I'm trying to create a function (in a package) to import a lot of data and create a symbol with UpValues to return specific results about the data. I've got it working fine in a regular notebook, but ...
107 views

### How do I add options to a built in function, which only apply to a certain class of argument?

I'd like to add an option to a built-in function that only applies when it is given an argument of a certain form. For example, something like this approach to extending ...
145 views

1k views

### Do people actually use UpValues?

I know what they are and how to define them. They have to serve some purpose - else why include them? But I never used them and all examples on this site and the docs never show a practical use of ...
822 views

### Emulating R data frame getters with UpValues

What's the best way to emulate R's data frames functionality? This includes the ability to select rows and columns in a 2-dimensional table by the string identifiers positioned typically in the first ...