[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Xpcall msgh must be a function
- From: Karel Tuma <kat@...>
- Date: Wed, 15 Oct 2014 13:36:37 +0200
Excerpts from Andrew Starks's message of 2014-10-14 19:34:30 +0200:
> My point is that I explored using an error handler object where the
> execution function was the call method and there was one handler for the
> entire "class". But I couldn't see how I could do that without creating a
+1 on this. I had to resort to closure spam too. Accepting any callable
could be useful extension and I can't think of anything breaking with it.
Still, theres a lot of lua code out there, perhaps there indeed is someone
depending on callable being invalid?
More incremental approach might be giving user the ability to supply msgh "data"
argument (which would hold the instance reference in the "class" case), thus
preventing closure spam. This means additional API, but semantics of existing
API and implementation would remain the same, instead of deeper redesign.
Essentially a bloat vs compatibility trade-off decision.