Hacker News new | ask | show | jobs
by scrumper 5039 days ago
I didn't understand as much as I'd have liked of the linked article. Let me check something. In Mathematica, are the M expressions the internal 'FullForm' representations of expressions? So, for example, I type:

    a = {1,2,3};
Which is represented internally as an 'M expression' of List[1,2,3] (obtainable through FullForm[a], or its head through Head[a])?

Is that it?

I didn't realise that was a named concept. It does make sense to have a completely unified internal representation underneath the syntactic sugar, since you'd need everything to be in that form for the term rewriting system to work.

Thanks!

1 comments

Yes, and for completeness I'd like to point out that this doesn't just apply to the right-hand side of the equation you gave. The "=" is just syntactic sugar to let you do variable assignment using infix notation:

In[1]:= FullForm[Hold[a={1,2,3}]]

Out[1]//FullForm= Hold[Set[a,List[1,2,3]]]

Worth pointing out, thanks! I see how that works.