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

Support for separators #3

Open
Airtz opened this issue Mar 29, 2022 · 1 comment
Open

Support for separators #3

Airtz opened this issue Mar 29, 2022 · 1 comment

Comments

@Airtz
Copy link

Airtz commented Mar 29, 2022

Hi @LyonSyonII

As of now I don't think there is a good way to express some repetitions:

impl<T> Foo for T where T: Baz<A> + Baz<B> + ... {}

//We could do
akin! {
    let &Type = [B, ...];
  
    let &bound = { + Baz<*Type> };
  
    impl<T> Foo for T where T: Baz<A> *bound {}
}

//Or
akin! {
    let &Type = [A, B, ...];
  
    let &separator = [NONE, +, ...]

    let &bound = { *separator Baz<*Type> };
  
    impl<T> Foo for T where T: *bound {}
}

It would be nice to be able to specify a separator. Maybe something along those lines:

akin! {
    let &Type = [A, B, ...];
  
    let &bound = { Baz<*Type> };
  
    impl<T> Foo for T where T: *{+}bound {}
}
@LyonSyonII
Copy link
Owner

The first option would be the cleanest for me (and the currently intended).

I don't think there is a real necessity for adding the feature (I prefer the simplest syntax possible), but you can make a PR if you want.

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

2 participants