Re: Releasing several Holds simultaneously
- To: mathgroup at smc.vnet.net
- Subject: [mg82275] Re: [mg82248] Releasing several Holds simultaneously
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Wed, 17 Oct 2007 03:48:20 -0400 (EDT)
- References: <200710160727.DAA08807@smc.vnet.net> <CEB61950-22A8-40B0-8215-045B159914FD@mimuw.edu.pl> <00b501c80fdc$bfb60ce0$8f01a8c0@moose>
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 >
- References:
- Releasing several Holds simultaneously
- From: "Andrew Moylan" <andrew.j.moylan@gmail.com>
- Releasing several Holds simultaneously