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

Fix optic parsing function #97

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Fix optic parsing function #97

merged 1 commit into from
Apr 17, 2024

Conversation

sunxd3
Copy link
Collaborator

@sunxd3 sunxd3 commented Apr 17, 2024

Current master branch:

julia> @macroexpand @varname(x[1])
:((VarName){:x}((AbstractPPL.Accessors).opticcompose((Accessors.IndexLens)((1,)))))

this branch

julia> @macroexpand @varname(x[1])
:((VarName){:x}((Accessors.opticcompose)((Accessors.IndexLens)((1,)))))

which is the right behavior and same to that with Setfield. Also ref https://github.com/JuliaObjects/Accessors.jl/blob/01528a81fdf17c07436e1f3d99119d3f635e4c26/src/sugar.jl#L271.

This should fix the exposure of Accessors issues blocking TuringLang/DynamicPPL.jl#585.

@yebai
Copy link
Member

yebai commented Apr 17, 2024

Excellent investigation, thanks @sunxd3!

@yebai yebai merged commit b9cd48b into main Apr 17, 2024
10 checks passed
@yebai yebai deleted the sunxd/fix_varname_macro branch April 17, 2024 16:04
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 this pull request may close these issues.

None yet

2 participants