-
Notifications
You must be signed in to change notification settings - Fork 137
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
Ability to define custom destructorings #276
Comments
Hi Ivan. This is something I haven't considered but it shouldn't be terribly difficult as you say. One would need to make sure the recursive expansions would still work, but so long as you do not publish your custom getter I guess the contract is your own. The place to start at would be in the function Would you be interested in trying to implement this (does what I said make any sense at all? :)) |
I have checked the code upfront, just wanted to know whether you are going to accept such PR - check #277 . I have not updated the docs if this is needed. |
@Fuco1 is there a change to move this issue forward? In lsp-mode we are want to support both maps and alists and we are going to replace gethash with map-elt but we still do not have a solution for |
@yyoncho I will merge this today, I promise! |
Thank you @Fuco1 . Not sure whether it is ready for merging though (e. g. it lacks documentation). |
At this point,
dash
supports 4 different destructoring keyword (keys/hash/plist/alist) and from what I can see it will be not hard to add new keywords by providing a destructuring template(or macro?) to generate the getter.Example usecases:
&hash
which checks whether the map is empty before applying gethashcl-defstruct
, e. g.The text was updated successfully, but these errors were encountered: