rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
95.11k stars 12.27k forks source link

do foo!(...) { ... } #9358

Closed orenbenkiki closed 10 years ago

orenbenkiki commented 10 years ago

Currently writing do foo!(...) { ... } (where foo!(...) expands to foo(...)) fails with an error "error: do must be followed by a block call".

This makes it impossible to write eDSLish macros that use blocks. Instead one must write foo!(..., { ... }) which looks much uglier.

It is also impossible to have foo!(...) expand to do foo(...) and then write foo!(...) { ... }. This is probably undesirable anyway.

At any rate - this restriction seems to be the result of a specific AST structure (wild guess here) rather than an intentional limitation. Is there a chance it can be lifted (to allow for better eDSL-ish notations)?

thestinger commented 10 years ago

The do feature has been removed.