Re: Sequence and Or
- To: mathgroup at smc.vnet.net
- Subject: [mg34194] Re: [mg34179] Sequence and Or
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Thu, 9 May 2002 05:15:55 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Wednesday, May 8, 2002, at 01:57 AM, DrBob wrote: > When I evaluate the following... > > {True,False,True} > Or@@% > Sequence@@% > Or[%] > This doesn't do what you are expecting if you place all the expressions in the same cell in a notebook. The % in that case will refer to the result of the last cell evaluated not the last expression evaluated. If you place these expressions in different cells and evaluate the cells in order you will get something closer to what you expect. > the outputs are: > > {True,False,True} > True > Sequence[True,False,True] > Sequence[True,False,True] > > while I had expected: > > {True,False,True} > True > Sequence[True,False,True] This is actually wrong if you evaluate the expressions in separate cells. At that point % refers to the value of Or@@{True,False,True} which is True so you will see Sequence[True] here. > True > > What am I missing? > I think you have a little misunderstanding of how % works. Regards, Ssezi