MathGroup Archive 2009

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

Search the Archive

Re: Head logic

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97058] Re: Head logic
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 4 Mar 2009 07:12:00 -0500 (EST)
  • References: <goj2bk$2qu$1@smc.vnet.net>

Hi,

may be there is a reason why there exist SameQ[]
(===) and UnsameQ[] (=!=).

The reason is that
a==b is may be true if a and b have values but general
this is an equation. If want to test something that
must yield True or False use SameQ[] anf UnsameQ[]

Regards
   Jens

carlos at colorado.edu wrote:
> Entering
> 
>    ClearAll[r];
>    Head[r]
>    Head[r]!=Symbol
>    Head[r]==Symbol
> 
> give Symbol, False and True as expected. But
> 
>    Head[r]==Integer
> 
> evaluates to Symbol==Integer. Why not False?
> Head[r] is certainly not Integer. Likewise
> 
>   r=4;
>   Head[r]==Integer
>   Head[r]!=Symbol
>   Head[r]==Symbol
> 
> give True (correct) but  Integer!=Symbol and Integer==Symbol.
> Why not True and False?
> 


  • Prev by Date: MatrixRank[m, Modulus -> 5] is broken
  • Next by Date: Re: Head logic
  • Previous by thread: Re: Head logic
  • Next by thread: Re: Head logic