Open jonas-schulze opened 1 year ago
I think what you want is Layers([])
:
julia> Layers([]) + mapping(:x, :y)
Layers with 1 elements:
Layer 1
transformation: identity
data: Nothing
positional:
1: x
2: y
named:
julia> Layers([]) * mapping(:x, :y)
Layers with 0 elements:
Yes, that's the behavior I was looking for! But Layers([])
doesn't feel intuitive to me (I don't remember interacting with it before), I will likely forget about it again. What do you think about giving the other names I suggested?
Problem description
I would like to have an optional layer in the background, to which I then add some other layers on top. The manual states that
mapping()
is the one-element, but what is the zero-element here?Proposed solution
Define
zero(Layer)
orAoG.zero()
or similar. While being at it, one may also defineone(Layer)
oroneunit(Layer)
orAoG.one()
or similar.