Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Head logic

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97059] Re: [mg97033] Head logic
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Wed, 4 Mar 2009 07:12:10 -0500 (EST)
  • References: <200903031055.FAA02912@smc.vnet.net>
  • Reply-to: drmajorbob at bigfoot.com

There are times when === is your friend, rather than ==.

Bobby

On Tue, 03 Mar 2009 04:55:49 -0600, <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?
>



-- 
DrMajorBob at bigfoot.com


  • Prev by Date: question about mathlink.h
  • Next by Date: Re: Hasse Diagram
  • Previous by thread: Head logic
  • Next by thread: Re: Head logic