4 ms·
Never took off? In addition to the other replies, look at Mathematica/Wolfram Language where they are _the_ syntax: f[1, 2, 3] And we can index it Pa
by henrikeh 7y ago
Never took off? In addition to the other replies, look at Mathematica/Wolfram Language where they are _the_ syntax:
f[1, 2, 3]
And we can index it
Part[f[1, 2, 3], 1] == 1
Now what would the 0th element be?
Part[f[1, 2, 3], 0] == f
It is “head” or what corresponds to the first element in cons lists.
Also, as an appendix, there is no reason why you can’t have a “high-level” syntax and an abstract syntax which can both coexist. Mathematica has a syntax which can get quite cryptic (almost APL like at times), but it is possible to ask “freeze” expressions and print out the full m-expression form and thus inspect the structure of a function or similar.
- logicprog 7y agoYeah it's possible, but it leads to somewhat awkward languages where you have sometimes multiple levels of desugaring going on and it's annoying. The last time I looked into Julia (IIRC >6 years ago) it had something similar going on and it really scared me off. The problem with having a "technically homoiconic" language is that you're going to end up with not only lots of desugaring, but multiple syntaxes for the same things.