-
Notifications
You must be signed in to change notification settings - Fork 3
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
customize when to prefer built-ins over clauses and vice versa #63
Comments
My thinking was that in That is, I don't know the benefit to using the What is your use case that you would prefer the command to form? Do you have other examples of this for other commands? |
Sorry for the very late response.
At the time my use case were the examples I presented in #109 (one of which I show below). To try to describe the situation: I want to have multiple separate loops in the same body that share the same "environment". Below both loops collect to the same (defmacro with-map! (map &rest body)
"Let-bind dotted symbols to their values in BODY.
This is similar to `let-alist' but map can be any key value structure."
(declare (indent 1))
(iter (dolist (dot-sym (oo-dot-symbols body))
(expr name (macroexp-quote (oo-dot-symbol-name dot-sym)))
(collect let-binds (list name dot-sym)))
(dolist (asterix-sym (oo-asterix-symbols body))
(expr name (oo-keyword-intern (oo-asterix-symbol-name asterix-sym)))
(collect let-binds (list name asterix-sym)))
(return `(map-let ,let-binds ,map ,@body))))
I don't have examples for other commands. Maybe |
After a series of changes to ;; => (1 2 2 4)
(loopy-iter (listing i '(1 2 3))
(for while (< i 3))
(collecting i)
(accum collect (* 2 i))) Since the idea for loopy clauses without a built-in |
It is worth noting that the "while" clause does not work in
iter
(assuming thelax-naming
flag is enabled) becauseiter
uses the built-in while. Might be useful to have a custom variable for specifying for which commandsiter
should prefer built-ins and which it should prefer clauses.Right now there's
loopy-iter-ignored-commands
which stops loopy iter from prioritizing some clauses over built-ins. But you should be able to go the other way around too. So I can say if you see awhile
assume it is a clause and not the built-in.The text was updated successfully, but these errors were encountered: