3 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/

Actually we have direct control over this via a System Option. Set:

SetSystemOptions["DefinitionsReordering" -> "None"];


Then:

Clear[f];
f[x_] := Sin[x];
f[x_?EvenQ] := x;
f[x_?OddQ] := x^2;
{f[1], f[2], f[3], f[4], f[3/2], f[Newton]}

{Sin[1], Sin[2], Sin[3], Sin[4], Sin[3/2], Sin[Newton]}


Restore the default behavior with:

SetSystemOptions["DefinitionsReordering" -> "Default"];


By the way this reordering takes significant time; by disabling it I was able to make an already efficient solution more than twice as fast for http://mathematica.stackexchange.com/questions/8154/how-to-select-minimal-subsets/8160#8160How to select minimal subsets?

### Prophylactic

Leonid expressed concern about the generality of the effect of this setting. Here is an attempt to localize its behavior.

SetAttributes[nonOrder, {HoldFirst, SequenceHold}]

nonOrder[{body_}] :=
InternalWithLocalSettings[
SetSystemOptions["DefinitionsReordering" -> "None"],
body,
SetSystemOptions["DefinitionsReordering" -> "Default"]
]

nonOrder[LHS_ = RHS_] := nonOrder[LHS, RHS]
nonOrder[LHS_, RHS_] := nonOrder @ {LHS = Unevaluated @ RHS}
nonOrder[sd : (LHS_ := RHS_)] := nonOrder @ {sd}


With this internal definitions made during the evaluation of the right hand side in Set are ordered normally.

ClearAll[f, foo, bar, baz]

foo[] := (bar[x_] := Sin[x]; bar[x_?OddQ] := x^2; baz)

nonOrder[  f[1] = foo[]  ];
nonOrder[  f[x_ /; x > 1] := 2 + 2  ]

?f
?bar

Globalf

f[1]=baz

f[x_/;x>1]:=2+2

Globalbar

bar[x_?OddQ]:=x^2

bar[x_]:=Sin[x]


Note that f is not automatically ordered, as intended, while bar is ordered, as intended.

Actually we have direct control over this via a System Option. Set:

SetSystemOptions["DefinitionsReordering" -> "None"];


Then:

Clear[f];
f[x_] := Sin[x];
f[x_?EvenQ] := x;
f[x_?OddQ] := x^2;
{f[1], f[2], f[3], f[4], f[3/2], f[Newton]}

{Sin[1], Sin[2], Sin[3], Sin[4], Sin[3/2], Sin[Newton]}


Restore the default behavior with:

SetSystemOptions["DefinitionsReordering" -> "Default"];


By the way this reordering takes significant time; by disabling it I was able to make an already efficient solution more than twice as fast for http://mathematica.stackexchange.com/questions/8154/how-to-select-minimal-subsets/8160#8160

### Prophylactic

Leonid expressed concern about the generality of the effect of this setting. Here is an attempt to localize its behavior.

SetAttributes[nonOrder, {HoldFirst, SequenceHold}]

nonOrder[{body_}] :=
InternalWithLocalSettings[
SetSystemOptions["DefinitionsReordering" -> "None"],
body,
SetSystemOptions["DefinitionsReordering" -> "Default"]
]

nonOrder[LHS_ = RHS_] := nonOrder[LHS, RHS]
nonOrder[LHS_, RHS_] := nonOrder @ {LHS = Unevaluated @ RHS}
nonOrder[sd : (LHS_ := RHS_)] := nonOrder @ {sd}


With this internal definitions made during the evaluation of the right hand side in Set are ordered normally.

ClearAll[f, foo, bar, baz]

foo[] := (bar[x_] := Sin[x]; bar[x_?OddQ] := x^2; baz)

nonOrder[  f[1] = foo[]  ];
nonOrder[  f[x_ /; x > 1] := 2 + 2  ]

?f
?bar

Globalf

f[1]=baz

f[x_/;x>1]:=2+2

Globalbar

bar[x_?OddQ]:=x^2

bar[x_]:=Sin[x]


Note that f is not automatically ordered, as intended, while bar is ordered, as intended.

Actually we have direct control over this via a System Option. Set:

SetSystemOptions["DefinitionsReordering" -> "None"];


Then:

Clear[f];
f[x_] := Sin[x];
f[x_?EvenQ] := x;
f[x_?OddQ] := x^2;
{f[1], f[2], f[3], f[4], f[3/2], f[Newton]}

{Sin[1], Sin[2], Sin[3], Sin[4], Sin[3/2], Sin[Newton]}


Restore the default behavior with:

SetSystemOptions["DefinitionsReordering" -> "Default"];


By the way this reordering takes significant time; by disabling it I was able to make an already efficient solution more than twice as fast for How to select minimal subsets?

### Prophylactic

Leonid expressed concern about the generality of the effect of this setting. Here is an attempt to localize its behavior.

SetAttributes[nonOrder, {HoldFirst, SequenceHold}]

nonOrder[{body_}] :=
InternalWithLocalSettings[
SetSystemOptions["DefinitionsReordering" -> "None"],
body,
SetSystemOptions["DefinitionsReordering" -> "Default"]
]

nonOrder[LHS_ = RHS_] := nonOrder[LHS, RHS]
nonOrder[LHS_, RHS_] := nonOrder @ {LHS = Unevaluated @ RHS}
nonOrder[sd : (LHS_ := RHS_)] := nonOrder @ {sd}


With this internal definitions made during the evaluation of the right hand side in Set are ordered normally.

ClearAll[f, foo, bar, baz]

foo[] := (bar[x_] := Sin[x]; bar[x_?OddQ] := x^2; baz)

nonOrder[  f[1] = foo[]  ];
nonOrder[  f[x_ /; x > 1] := 2 + 2  ]

?f
?bar

Globalf

f[1]=baz

f[x_/;x>1]:=2+2

Globalbar

bar[x_?OddQ]:=x^2

bar[x_]:=Sin[x]


Note that f is not automatically ordered, as intended, while bar is ordered, as intended.

2 added 1198 characters in body

Actually we have direct control over this via a System Option. Set:

SetSystemOptions["DefinitionsReordering" -> "None"];


Then:

Clear[f];
f[x_] := Sin[x];
f[x_?EvenQ] := x;
f[x_?OddQ] := x^2;
{f[1], f[2], f[3], f[4], f[3/2], f[Newton]}

{Sin[1], Sin[2], Sin[3], Sin[4], Sin[3/2], Sin[Newton]}


Restore the default behavior with:

SetSystemOptions["DefinitionsReordering" -> "Default"];


By the way this reordering takes significant time; by disabling it I was able to make an already efficient solution more than twice as fast for http://mathematica.stackexchange.com/questions/8154/how-to-select-minimal-subsets/8160#8160

### Prophylactic

Leonid expressed concern about the generality of the effect of this setting. Here is an attempt to localize its behavior.

SetAttributes[nonOrder, {HoldFirst, SequenceHold}]

nonOrder[{body_}] :=
InternalWithLocalSettings[
SetSystemOptions["DefinitionsReordering" -> "None"],
body,
SetSystemOptions["DefinitionsReordering" -> "Default"]
]

nonOrder[LHS_ = RHS_] := nonOrder[LHS, RHS]
nonOrder[LHS_, RHS_] := nonOrder @ {LHS = Unevaluated @ RHS}
nonOrder[sd : (LHS_ := RHS_)] := nonOrder @ {sd}


With this internal definitions made during the evaluation of the right hand side in Set are ordered normally.

ClearAll[f, foo, bar, baz]

foo[] := (bar[x_] := Sin[x]; bar[x_?OddQ] := x^2; baz)

nonOrder[  f[1] = foo[]  ];
nonOrder[  f[x_ /; x > 1] := 2 + 2  ]

?f
?bar

Globalf

f[1]=baz

f[x_/;x>1]:=2+2

Globalbar

bar[x_?OddQ]:=x^2

bar[x_]:=Sin[x]


Note that f is not automatically ordered, as intended, while bar is ordered, as intended.

Actually we have direct control over this via a System Option. Set:

SetSystemOptions["DefinitionsReordering" -> "None"];


Then:

Clear[f];
f[x_] := Sin[x];
f[x_?EvenQ] := x;
f[x_?OddQ] := x^2;
{f[1], f[2], f[3], f[4], f[3/2], f[Newton]}

{Sin[1], Sin[2], Sin[3], Sin[4], Sin[3/2], Sin[Newton]}


Restore the default behavior with:

SetSystemOptions["DefinitionsReordering" -> "Default"];


By the way this reordering takes significant time; by disabling it I was able to make an already efficient solution more than twice as fast for http://mathematica.stackexchange.com/questions/8154/how-to-select-minimal-subsets/8160#8160

Actually we have direct control over this via a System Option. Set:

SetSystemOptions["DefinitionsReordering" -> "None"];


Then:

Clear[f];
f[x_] := Sin[x];
f[x_?EvenQ] := x;
f[x_?OddQ] := x^2;
{f[1], f[2], f[3], f[4], f[3/2], f[Newton]}

{Sin[1], Sin[2], Sin[3], Sin[4], Sin[3/2], Sin[Newton]}


Restore the default behavior with:

SetSystemOptions["DefinitionsReordering" -> "Default"];


By the way this reordering takes significant time; by disabling it I was able to make an already efficient solution more than twice as fast for http://mathematica.stackexchange.com/questions/8154/how-to-select-minimal-subsets/8160#8160

### Prophylactic

Leonid expressed concern about the generality of the effect of this setting. Here is an attempt to localize its behavior.

SetAttributes[nonOrder, {HoldFirst, SequenceHold}]

nonOrder[{body_}] :=
InternalWithLocalSettings[
SetSystemOptions["DefinitionsReordering" -> "None"],
body,
SetSystemOptions["DefinitionsReordering" -> "Default"]
]

nonOrder[LHS_ = RHS_] := nonOrder[LHS, RHS]
nonOrder[LHS_, RHS_] := nonOrder @ {LHS = Unevaluated @ RHS}
nonOrder[sd : (LHS_ := RHS_)] := nonOrder @ {sd}


With this internal definitions made during the evaluation of the right hand side in Set are ordered normally.

ClearAll[f, foo, bar, baz]

foo[] := (bar[x_] := Sin[x]; bar[x_?OddQ] := x^2; baz)

nonOrder[  f[1] = foo[]  ];
nonOrder[  f[x_ /; x > 1] := 2 + 2  ]

?f
?bar

Globalf

f[1]=baz

f[x_/;x>1]:=2+2

Globalbar

bar[x_?OddQ]:=x^2

bar[x_]:=Sin[x]


Note that f is not automatically ordered, as intended, while bar is ordered, as intended.

1

Actually we have direct control over this via a System Option. Set:

SetSystemOptions["DefinitionsReordering" -> "None"];


Then:

Clear[f];
f[x_] := Sin[x];
f[x_?EvenQ] := x;
f[x_?OddQ] := x^2;
{f[1], f[2], f[3], f[4], f[3/2], f[Newton]}

{Sin[1], Sin[2], Sin[3], Sin[4], Sin[3/2], Sin[Newton]}


Restore the default behavior with:

SetSystemOptions["DefinitionsReordering" -> "Default"];
`

By the way this reordering takes significant time; by disabling it I was able to make an already efficient solution more than twice as fast for http://mathematica.stackexchange.com/questions/8154/how-to-select-minimal-subsets/8160#8160