MathGroup Archive 2003

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

Search the Archive

Re: Re: bug with definitions?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40421] Re: [mg40400] Re: bug with definitions?
  • From: Dr Bob <majort at cox-internet.com>
  • Date: Sat, 5 Apr 2003 03:57:13 -0500 (EST)
  • References: <b6gm2e$cf9$1@smc.vnet.net> <200304040621.BAA06066@smc.vnet.net>
  • Reply-to: majort at cox-internet.com
  • Sender: owner-wri-mathgroup at wolfram.com

It seems to me that using a pattern like _?z makes no sense (at all) if z 
will never evaluate to True, as in this case.  As a result, those two rules 
for a can never result in an evaluation.  Nothing can possibly match.

Bobby

On Fri, 4 Apr 2003 01:21:33 -0500 (EST), Jens-Peer Kuska 
<kuska at informatik.uni-leipzig.de> wrote:

> Hi,
>
> but Mathematica must do something with the right hand side of 
> RuleDelayed[] otherwise
> how become you rule a member of DownValues[] ??
>
> Since Catch[] and Throw[] are non-local operations,
> a Throw[] can not protected by the processing
> of the right hand side. Just use
>
> Clear[a, z];
> Catch[
> z[x_Integer] := 2;
> z[x_] := Throw[11];
> a[i_, iUp_?z] := 3;
> a[i_Integer, iUp_?z] := 5;
> ]
>
>
> Regards
> Jens
>
> Hein H wrote:
>>
>> Why does the following code cause and exception?  I thought that the
>> left hand side of := was not evaluated.
>>
>> Clear[a, z];
>> z[x_Integer] := 2;
>> z[x_] := Throw[11];
>> a[i_, iUp_?z] := 3;
>> a[i_Integer,  iUp_?z] := 5;
>>
>> Cheers,
>> Hein
>
>



-- 
majort at cox-internet.com
Bobby R. Treat



  • Prev by Date: Re: Defining function in loop
  • Next by Date: Re: Defining function in loop
  • Previous by thread: Re: bug with definitions?
  • Next by thread: RE: bug with definitions?