TransWikia.com

AssociationMap loses definition

Mathematica Asked by unlikely on July 21, 2021

Bug introduced in 10.0.0 and fixed in 10.1.0.


I’m facing a strange behavior of AssociationMap.

With a fresh Kernel session:

In[1]:= Definition@AssociationMap
Out[1]= Attributes[AssociationMap] = {Protected, ReadProtected}

After loading a package I’m developing, running some test against this package I sometimes end up with:

In[113]:= Definition@AssociationMap
Out[113]= Null

and AssociationMap no more evaluate anything.

I didn’t ovveride intentionally AssociationMap, and, because it is Protected, I suppose I cannot have ovverride accidentally.

Any help is appreciated.

UPDATE

After a lot of research I found the problem is related with the following minimal code.

Timing@<||>

AssociationMap[f, {a, b, c}]

The problem appear when putting the two expression in two different cells evaluating the two cells sequentially in a fresh Mathematica session. The problem doesn’t appear if:

  1. the two expression are evaluated at once, using “Evaluate Notebook” or putting the code in a single cell;
  2. or one suppress the Timing@;
  3. or one add another AssociationMap cell before the two and evaluate this new cell before the two others.

All tests done with Mathematica v10.0.1.0 under non-Admin account of Windows v8.1 x64.

Mathematica graphics

UPDATE 2

Wolfram Research confirmed this is a bug:

Hi Andrea, Thanks a lot for sending us the feedback. This is indeed a
serious issue and I’ve filed an incidence report on that. I’ve added
your information to the report to make sure that you will be informed
for any updates on this topic. Many thanks again. Regards,

[…] Wolfram Technology Engineer
Wolfram Research, Inc.

2 Answers

It seems I managed to reproduce the problem (M 10.0.1 or 10.0.2, OS X). It appears only when the suggestions bar is turned on and I wait for it to appear after every single output. This does appear to be a bug.

Workaround: turn off the suggestions bar.

Please do report this problem to support at wolfram.com.

enter image description here

The suggestions bar can be very useful for beginners, but it's been known to cause various problems in the past (many of those problems are already fixed). If you don't use the suggestions bar anyway, consider turning it off. The hint to the solution was that you mentioned that this doesn't happen either when the inputs are in the same cell or when you use Evaluate Notebook. Both prevent the suggestions bar form trying to interpret the output of Timing@<||>.

Correct answer by Szabolcs on July 21, 2021

This problem just started for me. AssociationMap was working last month in an existing notebook, now behaving as per report of OP. It exists in both 10.1 and 10.2 under Win7Pro64 (albeit I have both installed - maybe they share resources?). I had long ago turned off the suggestions bar. I have submitted a bug report to WRI. I have no special start-up (e.g. init.m), or customization config.

I have just identified a workaround: at beginning of Mathematica session, do:

Needs["GeneralUtilities`"]

Answered by frankeye on July 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP