-
Notifications
You must be signed in to change notification settings - Fork 16
implement element access API, extensions for Accessors #145
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
base: master
Are you sure you want to change the base?
Conversation
CI error is EnzymeAD/Enzyme.jl#2653, unrelated. |
const LENSES = Union{IndexLens,PropertyLens} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LENSES
is not used below:
const LENSES = Union{IndexLens,PropertyLens} |
(; transformations) = transformation | ||
repr1 = (transformations isa NamedTuple ? "NamedTuple" : "Tuple" ) * " of transformations" | ||
inner = _inner(transformation) | ||
repr1 = (inner isa NamedTuple ? "NamedTuple" : "Tuple" ) * " of transformations" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be simplified to something like
repr1 = (inner isa NamedTuple ? "NamedTuple" : "Tuple" ) * " of transformations" | |
repr1 = string(nameof(typeof(inner)), " of transformations") |
Helper function for accessing the `inner` field, as we define `getproperty` which masks | ||
this. Internal. | ||
""" | ||
@inline _inner(t) = getfield(t, :inner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the @inline
annotations actually needed?
|
||
const LENSES = Union{IndexLens,PropertyLens} | ||
|
||
set(t::TransformTuple, ::typeof(_inner), inner) = TransformTuple(inner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should/could we here and in the following definitions restrict the third argument to suitable types?
No description provided.