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
@ismatch [1,2] ( [1,A] || [1,B] )
`A` not defined
`B` not defined
I tried a solution. Though it matches both variables to the same value.
binding.jl line 298
elseif is_expr(source, :(||), 2)
# disjunction: `(a || b)` where `a` and `b` are patterns.
subpattern1 = source.args[1]
subpattern2 = source.args[2]
#### As is, this assigns both :A and :B to the same variable - not sure how to change this ####
bp1, assigned1 = bind_pattern!(location, subpattern1, input, binder, assigned)
bp2, assigned2 = bind_pattern!(location, subpattern2, input, binder, assigned)
# compute the common assignments.
both = union(keys(assigned1), keys(assigned2)) #### change intersect to union
assigned = ImmutableDict{Symbol, Symbol}()
for key in both
v1 = get( assigned1, key, missing ) #### add missing default
v2 = get( assigned2, key, missing ) #### add missing default
if ismissing(v2) #### new case
assigned = ImmutableDict{Symbol, Symbol}(assigned, key, v1)
elseif ismissing(v1) #### new case
assigned = ImmutableDict{Symbol, Symbol}(assigned, key, v2)
elsif v1 == v2
#### same from here on
The text was updated successfully, but these errors were encountered:
Your proposed solution would cause the code to treat missing input values differently from other values, in some cases incorrectly. The current implementation treats missing just like any other value.
variables not in both options are not populated
I tried a solution. Though it matches both variables to the same value.
binding.jl line 298
The text was updated successfully, but these errors were encountered: