[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] NSLua: Yet another ObjC-Lua bridge
- From: Simon Cozens <simon@...>
- Date: Mon, 5 Oct 2015 08:04:52 +0900
On 05/10/2015 06:53, Coda Highland wrote:
> Just wondering if you had considered an API like:
>
> dc:openDocumentWithContentsOfURL{fileurl, display=true, error=nil}
I agree that the syntax looks nicer, but there are a couple of
challenges: first, you're now resolving the method name a lot later,
which is a bit of a pain (but can be overcome); second, and more
importantly, you need to construct the method name by pulling the keys
out of the table *in the right order*. The example you've given is fine
but how would you correctly construct a method name out of
dc:shouldCloseWindowController({wc, delegate=d, shouldCloseSelector=s,
contextInfo=c})
(or {wc, delegate=d, contextInfo=c, shouldCloseSelector=s}, which is
exactly the same table)?
Given that - and the fact that the syntax I have gone with is familiar
to users of other bridges such as PyObjC - I don't think it's worth the
change for a bit of syntactic sugar.
S