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

Code in Chapter 3 cannot compile #24

Open
codeworm96 opened this issue Jan 19, 2018 · 1 comment
Open

Code in Chapter 3 cannot compile #24

codeworm96 opened this issue Jan 19, 2018 · 1 comment

Comments

@codeworm96
Copy link

The compiler doesn't allow the ( a[n]: $sty:ty = $($inits:expr),+ ... $recur:expr ) pattern, as mentioned in https://danielkeep.github.io/tlborm/book/mbe-min-captures-and-expansion-redux.html, only =>, , and ; can follow a expr capture.

BTW, it seems that the MEMORYs in this code block should be MEM_SIZE.

@AurevoirXavier
Copy link

AurevoirXavier commented May 20, 2018

Yep, in rust 1.28, the code doesn't work.

It's just a guide. Writing it in that way to make more understandable. We can remove the ... and simply change it to:

// just separate them with ';' or '=>'
[$seq:ident [$ind:ident]: $sty:ty = $($inits:expr),+; $recur:expr]

[$seq:ident [$ind:ident]: $sty:ty = $($inits:expr),+ => $recur:expr]

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