Hacker News new | past | comments | ask | show | jobs | submit login

> As far as I know, "!" is just a convention to make macros obvious -- it seems unnecessary to me, too.

No, it's very necessary, as macros actually take arbitrary token sequences as an 'argument', so there's no guarantee that the contents will parse as Rust code (e.g. https://github.com/huonw/brainfuck_macros), furthermore, macros can transform this argument into arbitrary code.

Hence it's nice to have an in-source marker to avoid humans and compilers having to work out if a certain name has strange semantics (particularly for compilers, to avoid having to intertwine parsing and name resolution: makes this simpler).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: