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

Macros that can ergonomically expand to a full protocol definition #4

Open
ebfull opened this issue Oct 23, 2015 · 1 comment
Open

Comments

@ebfull
Copy link
Owner

ebfull commented Oct 23, 2015

type Foo = protocol!(
    Recv usize,
    Send usize,
    Nest {
        Send usize,
        Nest {
            Recv usize,
            Choose [
                { Escape Z },
                {
                    Send usize,
                    Escape S<Z>
                }
            ]
        }
    }
);

should expand to

type Foo = Recv<usize,
                Send<usize,
                     Nest<Send<usize,
                               Nest<Recv<usize,
                                         Choose<Escape<Z>,
                                                Finally<Send<usize,
                                                             Escape<S<Z>>
                                                        >
                                                >
                                         >
                                    >
                               >
                          >
                     >
                >
           >
@ebfull
Copy link
Owner Author

ebfull commented Oct 24, 2015

Done, but now I need to do some trick that looks like this:

proto!(
    Atm = {
        Recv usize,
        Send usize,
        Fun = {
            Recv i8,
            Send i8,
            End
        }
    }
);

produces:

type Atm = Recv<usize, Send<usize, Fun>>;
type Fun = Recv<i8, Send<i8, End>>;

edit: I don't really need this it'd just be nice.

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