[textadept] Boolean Arguments

From: Robert <ro....at.web.de>
Date: Sun, 18 Dec 2011 21:31:44 +0100

Hi Mitchell,

there are quite a few cases in TA's API where some of the arguments
are boolean. If the function is not used very often this typically
requires looking up its meaning.
For a discussion of some real-world JavaScript API examples and
problems with boolean arguments see here:

One possibility would be to use tables as arguments, for example like

goto_view{1, relative = true} -- mixed named and positional arguments
goto_view{n = 1, relative = true}

Another option, a wrapper function

It is of course easy to look up the arguments because there is API
documentation available, still I think it would be better to have
something like
or view:split_horizontal() and view:split_vertical()

Possibly named functions are best, because they can be quickly used
through auto-completion.

Received on Sun 18 Dec 2011 - 15:31:44 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:26:35 EST