Questions tagged [attributes]

Questions on attributes of functions.

10 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11
votes
0answers
161 views

Alternatives and the Flat attribute

When a head has the attribute Flat then the pattern matcher is able to pick out a sublist of its arguments, even though the structure doesn't match: ...
7
votes
0answers
67 views

What's with the weird HoldRest Attribute of ParallelMap?

Bug introduced in 10.0 or earlier and persisting through 11.1 I have noticed some odd behavior of ParallelMap: When the list, that is mapped over, is not inserted ...
4
votes
0answers
71 views

How to get f[x] to match with f[c_., x] when OneIdentity doesn't match

After setting: SetAttributes[f, OneIdentity] Default[f] = 1; We have the following successful matches: ...
2
votes
0answers
33 views

Mathematica: Remove argument from object with flat attribute

I have an object in mathematica with the attributes Flat and OneIdentity. I also defined the following substitutions: ...
2
votes
0answers
118 views

What is the correct usage of HoldFirst?

I encountered a situation where using HoldFirst seems to do the trick for the specific task, but I am uncertain about the proper use of this attribute. Consider ...
2
votes
0answers
86 views

Internal`LocalizedBlock doesn't support Protected symbols and emits weird messages

Protect[x]; Internal`LocalizedBlock[{x[0]}, x[0] = 1; x[0]] ...
2
votes
0answers
76 views

Follow-up to “How to differentiate formally?”: Efficiency concern

In link to "how to differentiate formally?" and particularly to the answer by @Jens, I want to do something like this: ...
1
vote
0answers
77 views

Is it possible to modify the behavior of Listable?

Is it possible to achieve Thread-like behavior using the Listable attribute either on a symbol or in a pure function (or ...
0
votes
0answers
58 views

Why Plot is not a listable function but still take input as a list?

By using Attributes I can see that the function Plot is not a Listable function. ...
0
votes
0answers
211 views

`{Protected, ReadProtected}` System symbols give “Set::write: ”Tag * in *[v_] is Protected" on first try

Run Quit, then Unprotect@AbelianGroup; AbelianGroup[v_] = 0; Protect@AbelianGroup; where instead of ...