-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Typically there should only be a small number of name collisions when defining multiple ADT's hence a better semantic for the import macros would be to import all except a list which you specify.
Take the Scalar and Waveform ADT's I am using.
@adt ScalarLang begin
Scalar(::RealLang)
Negative(::ScalarLang)
struct Default
var::RealLang
value::Float64
end
struct Reduce
head::Symbol
literal::Float64
args::Dict{ScalarLang,Int}
end
struct Slice
duration::ScalarLang
Interval::ScalarLang
end
struct Interval
first::ScalarLang
last::ScalarLang
end
end
@adt WaveformLang begin
Negative(::WaveformLang) # Always try to move outside of over operations
Append(::Vector{WaveformLang})
# throw error when composing with this variant type
struct Pad
waveform::WaveformLang
alignment::AlignmentOption
value::PaddingValue
end
struct Name
waveform::WaveformLang
name::String
end
struct Add
lhs::WaveformLang
rhs::WaveformLang
end
struct Scale
waveform::WaveformLang
scale::ScalarLang
end
struct Slice
waveform::WaveformLang
interval::ScalarLang
end
struct Smooth
waveform::WaveformLang
kernel::KernelType
end
struct Instruction
shape::ShapeType
duration::ScalarLang
end
endThe only collisions I have are Slice and Negative Hence a semantic like:
@use_all_except WaveformLang: Slice, Negative
@use_all_except ScalarLang: Slice, NegativeReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels