Closed jcward closed 6 years ago
FYI, this is the lovely JS callback (and faux multi-var assignment) that haxe-continuation
implements:
And all this requires is a typical extern definition:
Usually I encounter this or similar error when I forgot to wrap using tink.MacroApi
with #if macro
. Is it your case?
If it is not by you, maybe you can try updating all your tink libraries to latest git version. Otherwise can you show the versions of your tink libraries?
It might have had something to do with conflicting using tink.CoreApi
and import <something else>
-- I vaguely trying to use the macro API in the same file ask Tink, and it exploded.
I tried again to create some wrapper to get the syntax I wanted out of Tink, and also exploring the exception handling. But again I failed to get to a workable API.
Ah well. Perhaps it's simply not for me.
Hi Juraj / Ben,
Sorry this isn't a very actionable bug report (because I cannot attach reproduction code), but I thought I'd report my experience anyway:
I was exploring and evaluating both
haxe-continuation
andtink_await
for a nodejs http server project, and at one point while I was testing tink_await, compilation failed with the following errors. You'll notice that none of the errors point to my end-user code. As such, this error message stumped me, and I couldn't pinpoint it to any specific change, hence I became suspicious of the amount of magic happening (and that'd I'd have to support it for my team), and I eventually gave up on tink_await.Beyond that, my experience has been that
haxe-continuation
is much easier to integrate, lighter weight (fewer dependencies), and just works for native JS functions with their natural callback signatures. It's a shame it doesn't support error handling / try / catch. But I suppose I could maybe hack something together.Maybe I have one actionable item: The tink_await docs / examples don't readily show how to wrap a native JS function, handling error and success. The only example I found was a trivial timeout. I hacked around to get this hideous monstrosity: