Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: The uses of Condition (/;)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82954] Re: The uses of Condition (/;)
  • From: Thomas E Burton <tburton at brahea.com>
  • Date: Sun, 4 Nov 2007 06:15:17 -0500 (EST)

Assuming that you mean (as in your examples for testing)

A. pattern /; condition := definition

I think A & B do yield the same results.

Despite the fact that Condition has a higher Precedence than  
SetDelayed and RuleDelayed, Condition seems to apply itself the  
entire assignment or rule, not just the definition.  Perhaps the  
documentation emphasizes both A and B to bring out this somewhat  
unexpected behavior.

> According to the documentation, /; can be used in three different  
> ways, illustrated below:
>
> A. pattern /; condition = definition
>
> B. pattern := definition /; condition
>
> C. pattern := Module[{}, definition /; condition]



  • Prev by Date: Re: Re: Manipulating a complex modulus expression
  • Next by Date: Re: Can you get a package back to a notebook easily?
  • Previous by thread: Re: The uses of Condition (/;)
  • Next by thread: Re: The uses of Condition (/;)