On 05/06/14 19:11, [email protected] wrote:

I was also planning to add sql!() macro almost exactly same as Chris Morgan suggests. However, you can't directly access type-checking part of rustc in #![phase(syntax)] modules, which means you need some dirty hacks to peroperly type-check such macros.


The conventional approach is to expand to something that uses certain traits, meaning any external data has to satisfy those traits for the macro invocation to work. This technique is used by `println!` and `#[deriving]`, for example.

(I don't know if you regard this as a dirty hack or not.)


Huon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to