Re: Possible to fix glaring Gjs API issues before GNOME 4?



On Thu, Feb 28, 2013 at 12:04 AM, Martin Pitt <martin pitt ubuntu com> wrote:
Nikita Churaev [2013-02-27 23:26 +0400]: 
> 3. Gtk.TextBuffer.set_text(text, length) --- length argument is useless,
> since _javascript_ uses UTF-16 and length expects length of UTF-8 string.

I'm afraid we have to live with little oddities like this. I think
it's better to stay compatible with the C API and its documentation,
and all currently existing _javascript_ program which use the API than
breaking API and continuously chasing after weird cases like that.

I don't think skipping the length arg in this case could work even if API breakage was acceptable. I assume a skip implies a value of zero is used and in this case that would not work. A better alternative would be default value support. This way the oddity can be avoided in client code without breaking API and in general would be a very nice feature. However, new code using this would need to specify it only works with advanced versions of GLib or the libraries providing defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=558620

-Simon



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]