MathGroup Archive 2007

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

Search the Archive

Re: Releasing several Holds simultaneously


Yes, but there is nothing wrong with that. Identity[1] will always  
evaluate to 1 (in practically no time). In fact, I can see no good  
reason for using SetDelayed rather than Set in code like this.

Andrzej Kozlowski



On 16 Oct 2007, at 19:10, Andrew Moylan wrote:

> Ah yes Hold->Identity was the other thing I tried. I guess I was  
> put off by
> then having a defined like this:
>
> ?a
>>> Global`a
>>> a:=Identity[1]
>
>
>
> -----Original Message-----
> From: Andrzej Kozlowski [mailto:akoz at mimuw.edu.pl]
> Sent: Tuesday, 16 October 2007 7:58 PM
> To: Andrew Moylan
> Cc: mathgroup at smc.vnet.net
> Subject: Re: [mg82248] Releasing several Holds simultaneously
>
> *This message was transferred with a trial version of CommuniGate 
> (tm) Pro*
>
> On 16 Oct 2007, at 16:27, Andrew Moylan wrote:
>
>> Hold[a := Hold[1]]
>>
>> How can I release both of these Holds (and thus execute a:=1)
>> simultaneously?
>>
>> ReleaseHold[%] doesn't work; it evaluates a := Hold[1] before the
>> other hold is removed.
>>
>> % /. Hold[x_]:>x does the same thing, because /. only matches once  
>> per
>> part.
>>
>>
>   Hold[a := Hold[1]] /. Hold -> Identity
>
> a
> 1
>
> Andrzej Kozlowski
>



  • Prev by Date: RE: Releasing several Holds simultaneously
  • Next by Date: Re: Is this normal for Limit?
  • Previous by thread: RE: Releasing several Holds simultaneously
  • Next by thread: Re: Releasing several Holds simultaneously