[Date Index] [Thread Index] [Author Index]
Re: Head logic
In situations like this one ought really use SameQ and UnsameQ. True, in this case one can't assign values to Symbol or Integer, but Mathematica is clearly not using that fact and therefore does not know whether they are Equal or not. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: carlos at colorado.edu [mailto:carlos at colorado.edu] 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?