TypeFns, variadic generics, compile-time reflection, macro-like fns

(minor note:

Macros 2.0 is a planned thing. Macro invocations will also always have the ! to indicate that they expand to more code than just a simple function call.

Whether and how macros are able to interact with the type system is an unresolved question.

#![feature(decl_macro)]

macro my_macro($thing:ident) {
    // expands to
}

)

You’re implementing your events as callbacks, which can be straightforwardly subsumed into futures.

1 Like

so do that, in your code.

I prefer events, especially if they have some sort of inheritance - which mine do, even if using it isn’t the nicest thing in the world.

It’s fine to like this event system.

However,convincing people to change the language to suit your usecase requires that you have a good/convincing argument why this is an important feature that should be in the language,and non-contrived examples of using this feature that could be implemented if it were accepted.

I would recommend that you look for other cases where people asked for reflection in Rust,and start compiling them so that you can have a good argument for it.

BTW:As I said before I am not opposed to adding reflection to the language,I just don’t need it.

3 Likes

“Macro fns” expand to little more than just an #[inline(always)] function call - it’s a function call that can define statics. That’s it. That’s the whole selling point. It’s for performance.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.