Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I'm not sure I understand the spirit of your question. My apologies of this answer is obvious to you and you intended something else.

Simplify::badSet = "Function Set used in assumptions where is likely in error.";

SetAttributes[mySimplify, HoldAll];

mySimplify[expr_, assum_] :=
  Message[Simplify::badSet] /; ! FreeQ[Unevaluated@assum, Set]

mySimplify[else__] := Simplify[else]

Now:

mySimplify[x + y, x = a]

Simplify::badSet: Set used in assumptions where is likely in error. >>

You could overload Simplify itself if you are comfortable with such things. You'll want to be familiar with the Villegas-Gayley methodVillegas-Gayley method of you choose that path.

I'm not sure I understand the spirit of your question. My apologies of this answer is obvious to you and you intended something else.

Simplify::badSet = "Function Set used in assumptions where is likely in error.";

SetAttributes[mySimplify, HoldAll];

mySimplify[expr_, assum_] :=
  Message[Simplify::badSet] /; ! FreeQ[Unevaluated@assum, Set]

mySimplify[else__] := Simplify[else]

Now:

mySimplify[x + y, x = a]

Simplify::badSet: Set used in assumptions where is likely in error. >>

You could overload Simplify itself if you are comfortable with such things. You'll want to be familiar with the Villegas-Gayley method of you choose that path.

I'm not sure I understand the spirit of your question. My apologies of this answer is obvious to you and you intended something else.

Simplify::badSet = "Function Set used in assumptions where is likely in error.";

SetAttributes[mySimplify, HoldAll];

mySimplify[expr_, assum_] :=
  Message[Simplify::badSet] /; ! FreeQ[Unevaluated@assum, Set]

mySimplify[else__] := Simplify[else]

Now:

mySimplify[x + y, x = a]

Simplify::badSet: Set used in assumptions where is likely in error. >>

You could overload Simplify itself if you are comfortable with such things. You'll want to be familiar with the Villegas-Gayley method of you choose that path.

Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

I'm not sure I understand the spirit of your question. My apologies of this answer is obvious to you and you intended something else.

Simplify::badSet = "Function Set used in assumptions where is likely in error.";

SetAttributes[mySimplify, HoldAll];

mySimplify[expr_, assum_] :=
  Message[Simplify::badSet] /; ! FreeQ[Unevaluated@assum, Set]

mySimplify[else__] := Simplify[else]

Now:

mySimplify[x + y, x = a]

Simplify::badSet: Set used in assumptions where is likely in error. >>

You could overload Simplify itself if you are comfortable with such things. You'll want to be familiar with the Villegas-Gayley method of you choose that path.