Re: array handles and non-local exits

2009-07-23 Thread Andy Wingo
Hi, On Mon 20 Jul 2009 11:20, l...@gnu.org (Ludovic Courtès) writes: > Neil Jerram writes: > >> l...@gnu.org (Ludovic Courtès) writes: >> >>> Andy Wingo writes: > > [...] > Array_handle_release is a bad idea. >>> >>> Fair enough. >> >> FWIW, I agree (I think with both of you) that `we migh

Re: array handles and non-local exits

2009-07-20 Thread Ludovic Courtès
Hi Neil, Neil Jerram writes: > l...@gnu.org (Ludovic Courtès) writes: > >> Andy Wingo writes: [...] >>> Array_handle_release is a bad idea. >> >> Fair enough. > > FWIW, I agree (I think with both of you) that `we might need it in > future' is not a good argument, but that API compatibility is

Re: array handles and non-local exits

2009-07-19 Thread Neil Jerram
l...@gnu.org (Ludovic Courtès) writes: > Hey, > > Andy Wingo writes: > > [...] > >> You can't just write functions that return values, you have to contort >> code to store temporaries and then release and then return. You have >> to write paired statements. If you call a user function, you really

Re: array handles and non-local exits

2009-07-10 Thread Ludovic Courtès
Hey, Andy Wingo writes: [...] > You can't just write functions that return values, you have to contort > code to store temporaries and then release and then return. You have > to write paired statements. If you call a user function, you really > should set up a dynwind, which conses, and contor

Re: array handles and non-local exits

2009-07-10 Thread Andy Wingo
Hi, On Thu 09 Jul 2009 22:08, l...@gnu.org (Ludovic Courtès) writes: >> To me this is a weak argument, especially given that much code probably >> doesn't do the right thing in the presence of nonlocal exits. > > To me, *this* is a weak argument. ;-) Heh, allow me to elaborate then. "Let's keep

Re: array handles and non-local exits

2009-07-09 Thread Ludovic Courtès
Hello, Andy Wingo writes: > On Mon 06 Jul 2009 21:30, l...@gnu.org (Ludovic Courtès) writes: [...] >> Yes. OTOH, the doc doesn't say that concurrent array accesses are safe, >> so array accesses are supposed to be synchronized at the application >> level, using mutexes, I suppose. > > They sh

Re: array handles and non-local exits

2009-07-09 Thread Andy Wingo
Hi, On Mon 06 Jul 2009 21:30, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo writes: > >> Good question. I suppose you have this case in mind: >> >> (define s0 (string "foo")) >> (define s1 (substring/shared s0 0)) >> (define s2 (substring/shared s1 0)) >> (par-for-each (lambda

Re: array handles and non-local exits

2009-07-06 Thread Ludovic Courtès
Hello, Andy Wingo writes: > Good question. I suppose you have this case in mind: > > (define s0 (string "foo")) > (define s1 (substring/shared s0 0)) > (define s2 (substring/shared s1 0)) > (par-for-each (lambda (s) (string-set! s 0 #\b)) > (list s0 s1 s2)) Yes. OTO

Re: array handles and non-local exits

2009-07-06 Thread Andy Wingo
Hi, On Sun 05 Jul 2009 12:14, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo writes: > >> I'm hacking on this code right now, and have come to think that >> scm_array_handle_release is superfluous. It shouldn't protect against >> concurrent modification of the data, as that should be done w

Re: array handles and non-local exits

2009-07-05 Thread Ludovic Courtès
Hello, Andy Wingo writes: > I'm hacking on this code right now, and have come to think that > scm_array_handle_release is superfluous. It shouldn't protect against > concurrent modification of the data, as that should be done with > user-implemented mutexen. It obviously doesn't do anything now

Re: array handles and non-local exits

2009-07-05 Thread Andy Wingo
Hey folks :) On Thu 18 Sep 2008 11:17, "Neil Jerram" writes: > In my view, this part is still useful: > > "You must take care to always unreserve an array after reserving it, > also in the presence of non-local exits. To simplify this, reserving > and unreserving work like a dynwind context (see

Re: array handles and non-local exits

2009-07-03 Thread Neil Jerram
Neil Jerram writes: > [..] but I would like to > check that I haven't forgotten NEWS for the things I've worked on, and > I should be able to do that tomorrow evening or Saturday. I've done that now, resulting in [1], so please feel free to go ahead with the release whenever it is convenient for

Re: array handles and non-local exits

2009-07-02 Thread Neil Jerram
l...@gnu.org (Ludovic Courtès) writes: > Neil Jerram writes: > >> l...@gnu.org (Ludovic Courtès) writes: > >>> Maybe 1.8.7 is approaching now? >> >> Yes, that would be good. It might just be worth fixing the jmp_buf >> definition problem before that (which I should get to in the next week >> or

Re: array handles and non-local exits

2009-07-01 Thread Ludovic Courtès
Neil Jerram writes: > l...@gnu.org (Ludovic Courtès) writes: >> Maybe 1.8.7 is approaching now? > > Yes, that would be good. It might just be worth fixing the jmp_buf > definition problem before that (which I should get to in the next week > or so) - but on the other hand we already have plenty

Re: array handles and non-local exits

2009-07-01 Thread Neil Jerram
l...@gnu.org (Ludovic Courtès) writes: > Cool, thanks for going over all these loose ends! ;-) I'm really happy to be getting through them... these are things that have been sitting in my inbox for ages. > Maybe 1.8.7 is approaching now? Yes, that would be good. It might just be worth fixing

Re: array handles and non-local exits

2009-07-01 Thread Ludovic Courtès
Neil Jerram writes: > l...@gnu.org (Ludovic Courtès) writes: > >> Not quite. If get/release are left as is (i.e., they do not establish a >> dynwind context), I would write something along the lines of: >> >> You must take care to always unreserve an array after reserving it, >> also in t

Re: array handles and non-local exits

2009-06-30 Thread Neil Jerram
l...@gnu.org (Ludovic Courtès) writes: > Not quite. If get/release are left as is (i.e., they do not establish a > dynwind context), I would write something along the lines of: > > You must take care to always unreserve an array after reserving it, > also in the presence of non-local exits

Re: array handles and non-local exits

2008-09-18 Thread Ludovic Courtès
"Neil Jerram" <[EMAIL PROTECTED]> writes: > 2008/9/18 Ludovic Courtès <[EMAIL PROTECTED]>: >> I would suggest that we drop that mention of dynwinds from the manual. Just to clarify: I'm suggesting fixing the manual so that it conforms to the implementation, not the opposite. > In my view, this

Re: array handles and non-local exits

2008-09-18 Thread Neil Jerram
2008/9/18 Ludovic Courtès <[EMAIL PROTECTED]>: > > I submitted this bug: > > https://savannah.gnu.org/bugs/index.php?24292 That's great, thanks. > I would suggest that we drop that mention of dynwinds from the manual. In my view, this part is still useful: "You must take care to always unreser

Re: array handles and non-local exits

2008-09-18 Thread Ludovic Courtès
Hi, "Neil Jerram" <[EMAIL PROTECTED]> writes: and (2) I don't know of any other function that does a dynwind behind the scenes (IOW, let's not break the "rule of least surprise"). >> >> I meant "I don't know of a function that does a `dynwind_begin' >> *alone*" (of course there are plen

Re: array handles and non-local exits

2008-09-17 Thread Neil Jerram
2008/9/16 Ludovic Courtès <[EMAIL PROTECTED]>: > > If `get_handle ()' creates a dynwind that ends in `release_handle ()', > then code like the following will no longer work as expected: > > scm_dynwind_begin (); > scm_dynwind_unwind_handler (); > scm array_get_handle (); > > ... > > scm_dynwin

Re: array handles and non-local exits

2008-09-16 Thread Ludovic Courtès
Hello! "Neil Jerram" <[EMAIL PROTECTED]> writes: > 2008/9/15 Ludovic Courtès <[EMAIL PROTECTED]>: >> >> "Neil Jerram" <[EMAIL PROTECTED]> writes: >> >>> Now, as it happens, the code doesn't actually implement what the >>> manual says, and in fact scm_array_handle_release() is currently a >>> no-o

array handles and non-local exits

2008-09-15 Thread Neil Jerram
2008/9/15 Ludovic Courtès <[EMAIL PROTECTED]>: > > "Neil Jerram" <[EMAIL PROTECTED]> writes: > >> Now, as it happens, the code doesn't actually implement what the >> manual says, and in fact scm_array_handle_release() is currently a >> no-op! But I believe the manual's intention is sensible, so it