Timeline for What's the difference between 56 and Integer[56]?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 15, 2019 at 23:40 | history | edited | Fortsaint | CC BY-SA 4.0 |
[Edit removed during grace period]
|
Jul 15, 2019 at 23:16 | comment | added | Fortsaint |
@MadEmperorYuri You might also wonder why FullForm[a] is a , not Symbol[a]
|
|
Jul 15, 2019 at 22:58 | comment | added | MadEmperorYuri | My reasoning had gone like this: 1) Everything is a symbolic expression. 2) All symbolic expressions are composed of a head and any number of arguments. 3) Head[56] produces Integer. 4) The information that the integer is 56 must be kept somewhere. 5) That information can't be the head, since that's Integer. 6) So it must be an argument. 7) Therefore, FullForm[56] should produce Integer[56], the same way FullForm[{a, b}] produces List[a, b]. I'm now unstuck as far as this question is concerned, but I'll be making another one that focuses on atomic objects not behaving atomically. | |
Jul 15, 2019 at 22:53 | comment | added | John Doty |
Named "functions" in Mathematica are tricky things. Sin[x] doesn't evaluate like a function, but gets treated as a transformable symbolic expression by machinery whose rules incorporate the properties of the sine function. There is no built-in rule that does anything with Integer[56] .
|
|
Jul 15, 2019 at 21:36 | comment | added | Fortsaint |
Just two expressions sharing the same Head , likewise Head /@ {a, f[a]} returns {f,f}
|
|
Jul 15, 2019 at 21:28 | comment | added | Jason B. |
The fact that Head /@ {56, Integer[56]} returns {Integer, Integer} is probably the source of some confusion.
|
|
Jul 15, 2019 at 21:25 | history | answered | Fortsaint | CC BY-SA 4.0 |