-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add a with-slots
macro
#118
Comments
maybe it should not set the variables to pointers but the values, since setting multiple values of a struct is also possible using |
Though this is useful, I'm not sure the core is the right place for it, at least at the moment. An example definition without error-checking has been added to the repository at 8648e76, though, if you want to use it in your own code. |
I wrote some version of this myself, but I'm not sure if it's useful, when you can't use it for both getting and setting values |
The definition in the repository can be used to both get and set values, because the new bindings are pointers, rather than values. Is there something about it that doesn't work as expected? |
the problem if with-slots uses pointers, not values, it doesn't get that much easier: I'd still have to write |
another more usable solution may be something like symbol-macrolet (which works similar to mfor), so that with-slots (and also with-accessors) may work as now, only that the variables will be symbol-macros, dereferencing the pointers, which are used in the current version. |
Something like this
should expand to this
(like in CL)
The text was updated successfully, but these errors were encountered: