QEDjl-project / QEDprocesses.jl

[WIP]: QEDprocesses.jl: Modeling of scattering processes for QED.jl
MIT License
1 stars 3 forks source link

User-friendly constructors #67

Open szabo137 opened 1 month ago

szabo137 commented 1 month ago

There are some functions/constructors which are called on tuples of stuff. We should think about adding some convenience layer such that the user can call such functions on vectors of stuff or in a splatted way as well.

Something like this:

func(x::Tuple) = <do things with x> 
func(x::AbstractVector) = func(tuple(x...))
func(x::T...) where {T} = func(x) 

With this, we avoid having errors all the time, if someone uses the wrong parenthesis, e.g.

TestProcess([Electron(),Photon()],[Electron(),Photon()])

instead of

TestProcess((Electron(),Photon()),(Electron(),Photon()))