Group Abstract Group Abstract

Message Boards Message Boards

0
|
4K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

HoldAll Attribute of Function is not respected by MapAt in Version 10.0.2

Posted 11 years ago
POSTED BY: David Reiss
4 Replies

I hear fire engines outside...

POSTED BY: David Reiss

Okay. Actually I now feel free to pick away (read: turns out it wasn't mine). I filed a detailed report and expect it will not be too hard to track down.

POSTED BY: Daniel Lichtblau

Pick away!

Actually I found the problem in something else... And, yes, I put the CreateWindow in the example as I was ferreting things out from a much bigger piece of code so that I could see the problem happening explicitly from the window appearing and "bugging" me.

But your point is well taken.

And here is a simplification (I think ;-) ) that removes the pure function and focuses on the violation of the HoldAll:

In[1]:= Attributes[g] = {HoldAll};

In[2]:= g[Sin[2.]]

Out[2]= g[Sin[2.]]

In[3]:= MapAt[f, g[Sin[2.]], 1]

Out[3]= g[f[0.909297]]
POSTED BY: David Reiss

(Sorry to pick on you, but) Why is this not a very good bug report?

The answer is that it allows for too many possibilities. For one, it invokes functionality only found in the User Interface. Is it a UI-specific bug? Kernel?

Try this variant:

MapAt[f, Function[z, Sin[2.]],2]

(Upshot: it's a kernel issue.)

Don't fret though, you might get the last laugh here (read: it could be mine).

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard