You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having an issue with Diffractor with TransformVariables.jl.
I have isolated the issue to this function. Diffractor it seems to forget the contents of the structure. Any idea what might be going wrong?
using Diffractor
@inlineUNPACK(x, ::Val{f}) where {f} =getproperty(x, f)
@inlineUNPACK(x::AbstractDict{Symbol}, ::Val{k}) where {k} = x[k]
@inlineUNPACK(x::AbstractDict{<:AbstractString}, ::Val{k}) where {k} = x[string(k)]
macroUNPACK(args)
args.head!=:(=) &&error("Expression needs to be of form `a, b = c`")
items, suitecase = args.args
items =isa(items, Symbol) ? [items] : items.args
suitecase_instance =gensym()
kd = [:( $key =$UNPACK($suitecase_instance, Val{$(Expr(:quote, key))}()) ) for key in items]
kdblock =Expr(:block, kd...)
expr =quotelocal$suitecase_instance =$suitecase # handles if suitecase is not a variable but an expression$kdblock
$suitecase_instance # return RHS of `=` as standard in Juliaendesc(expr)
endfunctioner(tranforms)
@UNPACK transformations = tranforms
transformations
endstruct tr
transformations
ender(tr(1)) #Works
Diffractor.∂⃖recurse{1}()(er,tr(1)) #Doesn't Work
The text was updated successfully, but these errors were encountered:
I've been having an issue with Diffractor with TransformVariables.jl.
I have isolated the issue to this function. Diffractor it seems to forget the contents of the structure. Any idea what might be going wrong?
The text was updated successfully, but these errors were encountered: