haxetink / tink_await

Haxe async/await
MIT License
58 stars 15 forks source link

Runtime or compile time? #1

Closed kevinresol closed 8 years ago

kevinresol commented 8 years ago

First of all, great works! This library looks like a very nice complement to the tink libraries.

But looking at the readme I see the meta are @async and @await, so are they runtime transformation or not? Because I think that compile time meta has a convention of starting with @:, e.g @:async)

benmerckx commented 8 years ago

There's no runtime transformation. They get stripped by the macros so there's no real need for the colon. To be exact the 'async' meta I forgot to strip in this version, but that'll get fixed next. I have thought about supporting both forms, because I've already written @:await several times by accident which is hard to debug until you notice the typo.

kevinresol commented 8 years ago

I think @async looks like a runtime thing, due to convention. Maybe just support @:async while produce a warning (Context.warning()) when a @async is seen.

benmerckx commented 8 years ago

Both forms are supported now. I kind of like writing @await instead of @:await :)

kevinresol commented 8 years ago

Thanks! I prefer @:await though, because it is more consistent with the language =)