Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Can the connection between the syntax and the `Expr`s be clearer? #2786
No need to have a difference between
I have slightly incoherently(link FTR, no need read that) whined about it before, but it is much clearer in my head how it could be done.. Two things come close to capturing the syntax:
Of course there are weakness to this, for instance
I have written something like it here.
There is in fact a need to parse chains of
Parsing interpolated strings with head
I don't understand your point about beginners and enders. Of course we terminate an expression when we find its closing token. Example perhaps?
Good point. Of course you could do that after macroexpansion too? Like a compiler macro, or inlining
The idea with the beginners and enders is that you just have a function where you specify the infixes and 'hooks of various kinds', basically that
This is the 'simplest' way of entering, the list you feed as 'begin-enders' has functions like
The point of it is that i can call it a lisp with pretty good certaintly if the relationship between code and data is clear. It is fairly clear, but shifting a bit, and could be clearer. Really should have read
It's not implemented that way because it wouldn't work. There are many subtleties needed to get the behavior people intuitively expect, and to get line number nodes in the right places. If you want to make simplifications to the parser code, feel free to pull request. If it works I'll merge it.
What sort of subtileties exactly? I do realize this (unfortunately) it may have edge cases will have to be fixed in code, that cant be fixed without overly leaving the premise of the change.
I suppose i am fine with the syntax as it is now. Probably shouldnt take this on.. How infix notation is represented in the AST tree changes affects macros, macro writers should just flatten the
Edit: thanks for your time, hope i didnt waste it. I suppose "the behavior people intuitively expect" comes from your experience with this too much work to convey.