MathGroup Archive 2002

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

Search the Archive

Re: Sequence and Or

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34192] Re: [mg34179] Sequence and Or
  • From: Andrzej Kozlowski <andrzej at platon.c.u-tokyo.ac.jp>
  • Date: Thu, 9 May 2002 05:15:52 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Compare:

In[19]:=
Or[Sequence@@{True,False,True}]

Out[19]=
Sequence[True,False,True]

In[20]:=
Or[Evaluate[Sequence@@{True,False,True}]]

Out[20]=
True

In[21]:=
Or[Sequence[True,False,True]]

Out[21]=
True

The point is the HoldAll  attribute of Or. Because of it, when you enter 
Or[Sequence@@{True,False,True}]  only a single argument is passed to Or 
but Or with a single argument returns:

In[22]:=
Or[x]

Out[22]=
x

Andrzej Kozlowski
Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/



On Wednesday, May 8, 2002, at 02:57  PM, DrBob wrote:

> When I evaluate the following...
>
> {True,False,True}
> Or@@%
> Sequence@@%
> Or[%]
>
> 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]
> True
>
> What am I missing?
>
> Bobby Treat
>
>
>
>
>



  • Prev by Date: Re: Exporting Graphics
  • Next by Date: Re: Sequence and Or
  • Previous by thread: Re: Sequence and Or
  • Next by thread: Re: Sequence and Or