Fixing Combinatorica redefinition of Element
Posted
by
Yaroslav Bulatov
on Stack Overflow
See other posts from Stack Overflow
or by Yaroslav Bulatov
Published on 2011-01-15T22:48:31Z
Indexed on
2011/01/15
22:53 UTC
Read the original article
Hit count: 176
mathematica
My code relies on version of Element
which works like MemberQ
, but when I load Combinatorica
, Element
gets redefined to work like Part
. What is the easiest way to fix this conflict? Specifically, what is the syntax to remove Combinatorica's definition from DownValues
? Here's what I get for DownValues[Element]
{HoldPattern[
Combinatorica`Private`a_List \[Element] \
{Combinatorica`Private`index___}] :>
Combinatorica`Private`a[[Combinatorica`Private`index]],
HoldPattern[Private`x_ \[Element] Private`list_List] :>
MemberQ[Private`list, Private`x]}
© Stack Overflow or respective owner