       • To: mathgroup at smc.vnet.net
• Subject: [mg97065] Re: Head logic
• From: "Drago Ganic" <dganic at vodatel.net>
• Date: Wed, 4 Mar 2009 07:13:15 -0500 (EST)
• References: <goj2bk\$2qu\$1@smc.vnet.net>

```Hi Carlos,
this behavior/logic has nothing to do with Head, but with Mathematica's treatment of
Integer and Symbol symbols. Unfortunately those symbols which do not have
values and will never have values are interpreted by Mathematica in the same
way as variables like

In:= a == b
Out= a == b

and not like constants:

In:= Pi == MachinePrecision
Out= False

The behavior for variables is ok since the output depends on their current
values (e.g. b = a would evaluate to True; but {a = 3, b = 4} would evaluate
to False). In the case of symbols like Pi or E the value is fixed (attribute
Constant) and cannot be changed (attribute Protected) so predicates can
always give True or False.

If Mathematica would use the attribute Protected in its evaluation of
predicates (like  Equal[]) we would also get the expected definite behavior
for Symbol and Integer symbols.

This would generally mean that, for example

In:= Protect[{a, b}]
Out= {"a", "b"}

In:= a == b

would evaluate to False because the symbols have no values and are protected
(so cannot have values). Those symbols are then just pure symbols and not
variables. Integer and Symbol have both the Protected attributes and my
suggestion is that Mathmatica should use it in evaluations.

Greetings from Croatia,
Drago

<carlos at colorado.edu> wrote in message news:goj2bk\$2qu\$1 at smc.vnet.net...
> Entering
>
>   ClearAll[r];
>
> give Symbol, False and True as expected. But
>
>
> evaluates to Symbol==Integer. Why not False?
> Head[r] is certainly not Integer. Likewise
>
>  r=4;