Re: Setting socket options: so many, uhh, options!

2014-08-28 Thread Stephen R. van den Berg
Lance Dillon wrote: >Just throwing this out there, some modules have the functions present >regardless, and return a message or error code saying it isn't implemented if >it wasn't compiled in.? So another option is to have all the methods present, >and either return a message or error code, or

Re: Setting socket options: so many, uhh, options!

2014-08-28 Thread Lance Dillon
Just throwing this out there, some modules have the functions present regardless, and return a message or error code saying it isn't implemented if it wasn't compiled in.  So another option is to have all the methods present, and either return a message or error code, or throw an exception, and

Re: Setting socket options: so many, uhh, options!

2014-08-28 Thread Stephen R. van den Berg
Chris Angelico wrote: >Topic branch: rosuav/sockopt >Per Lance's suggestion, I've made a generic setsockopt() function. It >works only with integers, so it's not suitable for SO_LINGER, which >therefore should stay the way it is (linger() takes a magic parameter >of -1), but it works for any of the

Re: IOBuffer vs. Buffer

2014-08-28 Thread Stephen R. van den Berg
Stephen R. van den Berg wrote: >The actual reason I beefed up Buffer a bit lately is *because* I need >to do some protocol decoding of a byte stream. >Now I see IOBuffer arrive. In order to avoid code bloat, wouldn't it >be a better idea to integrate the functionality of IOBuffer into Buffer >and

Setting socket options: so many, uhh, options!

2014-08-28 Thread Chris Angelico
Topic branch: rosuav/sockopt Per Lance's suggestion, I've made a generic setsockopt() function. It works only with integers, so it's not suitable for SO_LINGER, which therefore should stay the way it is (linger() takes a magic parameter of -1), but it works for any of the simple boolean options.

Re: Branches for discussion: Pango.Layout xy_to_char, Stdio.File nodelay

2014-08-28 Thread Chris Angelico
On Fri, Aug 29, 2014 at 12:04 AM, Lance Dillon wrote: > Maybe both? Have individual methods for those who want to just call it, and > a setflags type method that you can pass bit flags into to set. That way if > you have several flags to set you can do it in one call, or just call the > one flag

Re: Branches for discussion: Pango.Layout xy_to_char, Stdio.File nodelay

2014-08-28 Thread Lance Dillon
Maybe both?  Have individual methods for those who want to just call it, and a setflags type method that you can pass bit flags into to set.  That way if you have several flags to set you can do it in one call, or just call the one flag you want to set. Won't add too much, and make it easier fo

Branches for discussion: Pango.Layout xy_to_char, Stdio.File nodelay

2014-08-28 Thread Chris Angelico
Both of these have been discussed previously, but now they're posted as topic branches in the main repo. (I've also pushed a few non-controversial GTK2 changes to the 8.0 and 7.8 branches.) Branch: rosuav/pango_xy_to_char Adds a new method xy_to_char() to the GTK2.Pango.Layout object, parallel to

Re: Fun with lfuns: `= and `[..]=

2014-08-28 Thread Stephen R. van den Berg
Martin B??hr wrote: >Excerpts from Stephen R. van den Berg's message of 2014-08-28 09:13:38 +0200: >> String.Buffer b="abcdef"; >> b+="ghi"; >> write(b); >> b="jkl"; >> b+="mno"; >> write(b); >> Then it strikes me as "obvious" that this would result in >> printing abcdefghi and jklmno. >what's no

Re: Fun with lfuns: `= and `[..]=

2014-08-28 Thread Martin Bähr
Excerpts from Stephen R. van den Berg's message of 2014-08-28 09:13:38 +0200: > String.Buffer b="abcdef"; > b+="ghi"; > write(b); > b="jkl"; > b+="mno"; > write(b); > > Then it strikes me as "obvious" that this would result in > printing abcdefghi and jklmno. what's not obvious is that b should s

Re: Fun with lfuns: `= and `[..]=

2014-08-28 Thread Stephen R. van den Berg
Chris Angelico wrote: >On Thu, Aug 28, 2014 at 4:09 PM, Stephen R. van den Berg wrote: >> The operation could be determined by "overloading" based on types. >> I.e. a String Buffer `=(string a) would only activate when the lvalue is >> a buffer type, and the rvalue is of type string. >Maybe. Stil