| Author |
Comment/Response |
Dims
|
04/25/10 12:45pm
If all integers have a Head of Integer, then why they do no match with pattern Integer[_]?
Log:
In[56]:= {1, 2, tt[3], 4.}
Out[56]= {1, 2, tt[3], 4.}
In[57]:= mylist = %
Out[57]= {1, 2, tt[3], 4.}
In[58]:= Position[mylist, tt[_]]
Out[58]= {{3}}
In[59]:= Position[mylist, Integer[_]]
Out[59]= {}
In[60]:= Head[mylist[[2]]]
Out[60]= Integer
In[61]:= Head[mylist[[3]]]
Out[61]= tt
In[62]:= Position[mylist, _Integer]
Out[62]= {{1}, {2}, {3, 1}}
URL: , |
|