Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-friendly constructors #67

Open
szabo137 opened this issue May 21, 2024 · 0 comments
Open

User-friendly constructors #67

szabo137 opened this issue May 21, 2024 · 0 comments

Comments

@szabo137
Copy link
Member

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()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant