After the usual and well-known warning

General::compat: "Combinatorica Graph and Permutations functionality has been superseded

that was present in version 10, a new warning appears:

SetDelayed::write: "Tag Element in a_List \[Element] {index___} is Protected."

This seems to be potentially serious.

Which statement in Combinatorica causes it, and what are the consequences?

Edit 2016/09/10: Found it.

Combinatorica contains a function Element:

Element[a_List, {index___}] := a[[index]]

The function Element in the environment System has the following added Information:

Element[patt, dom] asserts that any expression matching the pattern patt is an element of dom. The use of the function Element in Combinatorica is now obsolete, though the function call Element[a, p] still gives the pth element of nested list a, where p is a list of indices.

So why do some users not get the warning/error but I do?

• I only get the first warning on Linux. – b.gates.you.know.what Aug 26 '16 at 17:20
• I use "11.0.0 for Microsoft Windows (64-bit) (July 28, 2016)" – Wouter Aug 26 '16 at 17:30
• line 1 : DeleteCases[Names["@*"], str_ /; StringMatchQ[str, "\$*"] || StringMatchQ[ToString[FullForm[str]], "Formal"]]; line 2: << Combinatorica; – Wouter Aug 29 '16 at 19:08
• This is very strange. I can reproduce the problem after restarting Mathematica fully, including the front end. Then loading Combinatorica triggers the error. Loading it again is fine. From now on the error won't show even if I restart the kernel. It is necessary to restart the Front End too to let the error happen again. What's also strange is that Combinatorica does Unprotect the symbol Element, yet something either prevents this or restores the protected status. I suspect an interaction with auto-completion in the front end and setting the usage message on Element. – Szabolcs Sep 10 '16 at 20:34
• This looks like something that is worth reporting to Wolfram Support. Can you do that please? – Szabolcs Sep 10 '16 at 20:35

When the first message is generated, the message formatting code is autoloaded from .mx files. This may cause the attributes of certain symbols to be reset, or rather replaced with what has been stored in one of those .mx files.

A minimal example that can also be run in a standalone kernel

In[1]:= Unprotect[Element]; Attributes[Element]

Out[1]= {}

In[2]:= IntervalSlider;

In[3]:= Attributes[Element]

Out[3]= {Protected}

where the simple mention of IntervalSlider causes the NotebookTools/Controls.mx file to be autoloaded.

For a workaround of the Element problem, it is sufficient to Quiet the message:

Quiet[Needs["Combinatorica"], General::compat]