-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is quasiquote so complicated? #643
Comments
Hello. I have made the same suggestion in #384. The issue is long, here is the specific quote: Ideally, this choice for quasiquote should be documented more explicitly in the process guide... |
"different from most implementations". That is a strange remark to make as the MAL goal is to stimulate the independant development from specification in an idiomatic way, depending on the language. Pseudo code in the guide should merely be a proposal, and not force an implementation. My conclusion is that the pseudo code is handy for lisp, where you can cut a list easily between a first element and the remainder, and not at all handy for other languages. Could I trust my interpretation of the specification, quasiquote c.s. cost me 4 lines of code instead of 40. |
My answer was unclear. |
I would specify the quasiquote as follows:
For each item in a list:
- append the item to a news list unless:
-- It is an unquote list. Evaluate the list item first before appending it
-- It is a splice-unquote list. Instead of appending the list, append the items in the list in sequence.
The evaluation is not ambiguous, assuming quasiquote is not supposed to change the environment.
If the items do that as a side effect, I'm totally lost, especially if they are calculated from behind.
This is trivial to implement to the manipulation compared to with cons and concat. What am I missing here?
List and vectors in my implementation are consequitive, not linked. So each times rest is called I'm obliged to allocate a fresh area and copy the whole bunch. If the specification in terms of the classic cons has to do with ease of implementation?
The text was updated successfully, but these errors were encountered: