New answers tagged

9

To avoid any conflict with the built-in symbol for \[Element], I would use the small element symbol, ∊ instead (this is a different unicode character from ∈). Here is a way to define its use as an infix operator by way of a template: ClearAll[myMemberQ] appearanceIn[x_, y_] := TemplateBox[{x, y}, "myMemberQ", DisplayFunction :> (RowBox[{#1, "∊", #2}]...


2

The Notation package comes into its own for those areas requiring specialized 2D formatting within a notebook. For function's involving common usage however, such as the OP's variation on MemberQ, a custom function is likely to cause less issues in the long run (such functions are also more likely to be loaded within an init.m file which is inadvisable ...


11

The big issue here is that ∈ is a system defined symbol and messing with it in this way can have all manner of unintended consequences. You don't know what is using it behind the scenes. If you really need to then you can use Infix notion on your own in function. in[form_, list_] := MemberQ[list, form] Select[test, #~in~find &] (* {3, 4} *) Or ...



Top 50 recent answers are included