Skip to content
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

unpack into renamed local variables #2

Open
tpapp opened this issue Mar 8, 2023 · 1 comment
Open

unpack into renamed local variables #2

tpapp opened this issue Mar 8, 2023 · 1 comment

Comments

@tpapp
Copy link

tpapp commented Mar 8, 2023

See mauro3/UnPack.jl#18, for which I made a PR which got no response. I am wondering if you would accept a similar feature in this package.

@devmotion
Copy link
Owner

Generally, the main motivation for SimpleUnPack is to be simple and solely based on Base functionality (getproperty/getfield, and I would like to add similar convenience macros for setproperty!/setfield!). This ensures that there are no surprises and that it is consistent with the destructuring syntax in Base. So the number of features I'd like to add are quite limited.

That being said, I think your proposal sounds reasonable. IMO @unpack a as a1, b as c, ... = x would have been neat but we can't use as as the expression is not parsed correctly. So maybe a => a1 is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants