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

@memoize cannot handle underscore variables #31

Closed
matthias314 opened this issue Nov 3, 2024 · 2 comments · Fixed by #32
Closed

@memoize cannot handle underscore variables #31

matthias314 opened this issue Nov 3, 2024 · 2 comments · Fixed by #32

Comments

@matthias314
Copy link

Example:

julia> @memoize f(_::Val{N}) where N = N
ERROR: syntax: all-underscore identifiers are write-only and their values cannot be used in expressions around /usr/local/julia-depot/packages/Memoization/7WxyR/src/Memoization.jl:209

Of course one could omit the underscore. However, it would be great if the statement

All function definition or function call forms with args and/or kwargs and/or type parameters work.

from the READE file were true.

@matthias314
Copy link
Author

Great, thanks for the swift correction!

By the way, you can iterate over a String, so you could check that a (non-empty) Symbol sym is all-underscore simply by saying all(==('_'), string(sym)).

@marius311
Copy link
Owner

thanks, added (also tagged a new release)

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

Successfully merging a pull request may close this issue.

2 participants