Mixers.jl icon indicating copy to clipboard operation
Mixers.jl copied to clipboard

Could @Premix and @mix be linked to an abstract type?

Open Lincoln-Hannah opened this issue 3 years ago • 1 comments

Someithing like:

abstract type Drink

@premix @with_kw struct Fruitjuice{P,B}     {link to Drink}
    pommegranite::P
    orange::B
end

@mix @with_kw struct Soda{J}                {link to Drink}
    soda::J = 2u"L"
end

So that

struct Punch{L} <: Drink
    vodka::L
end

would be equivalent to

@Fruitjuice @Soda struct Punch{L} 
    vodka::L
end

Sorry If I've misunderstood the proper usage.

Lincoln-Hannah avatar Nov 11 '22 00:11 Lincoln-Hannah

No... mixins can be combined and Julia doesn't have multiple inheritance.

rafaqz avatar Nov 11 '22 07:11 rafaqz