I have been working on picking expressions apart using Head and Part and encountered a little mystery. Consider the canonical example
a + b + c
which has FullForm
Plus[a, b, c]
We expect, then, (a+b+c)[[0]] === Plus === Head[a+b+c] to be True, and it is. But then, we would expect (a+b+c)[[1;;3]] would be {a, b, c}, wouldn't we? But it isn't. The following is true:
(a + b + c)[[1;;3]] === (a + b + c)
Somehow, [[1;;3]], which is supposed to pick off elements 1 through 3 of its argument and put them in a List, doesn't get rid of the Head, which is element 0!
The questions are, then (and I will be grateful for hints and answers!)
Why doesn't
(a + b + c)[[1;;3]]get rid of(a + b + c)[[0]], theHead?What is the right way to get rid of the
Head?(a + b + c)[[0;;3]]produces0. I would expect it to produce{Plus, a, b, c}. Instead, it produces0. This just deepens the mystery for me! Why?
