-
Notifications
You must be signed in to change notification settings - Fork 15
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
Implement each() macro #158
Comments
Just a quick thought: maybe a watcher macro is too heavy-handed here. It seems that what's really going on is that an It's a little bit like jQuery's
jQuery calls this "delegated events", and it gives you access to both the |
I came back in my thoughts to the "delegated events" idea the other day. I believe it carries its own weight. I tried to write this up realistically:
Some immediate comments/thoughts:
|
Hm, maybe a
Now the |
Just noting in passing that the |
Coming back to the suggestion of I'd rather have something that respects the inside/outside relation:
One immediate benefit of this is that we can now group several macro declarations (and perhaps other declarations) inside the same First I felt it's unfortunate that |
The nice/consistent thing about the The not-so-nice/not-so-consistent thing is that macros declared in the This is related to the idea of an |
I just found this forgotten gist, and wanted to link it here for archival purposes. It's a great relief #349 actually provides a concrete answer to "The only question is how to inject that macro at the statement level." |
Re-reading this issue, it's interesting (and fantastic) how almost all the discussion in it has been superseded by #349. Two questions remain, though:
|
Without going into too much detail, something like:
would translate into the moral equivalent of
(That's almost a full specification of
each
— something need also be said about the semantics of multipleeach()
in a statement. I will leave that Pandora's box unopened for whoever decides to implement this.)Two details as I see it are necessary for this:
each
without it being a declared function.each
pragma tell its invoking parser to install a symboleach
into itself. The advantage to this would be that we could detect and die on redeclarations ofeach
(e.g. someone imports the pragma as well as declares their own subeach
).The text was updated successfully, but these errors were encountered: