unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Neil Jerram" <neiljerram@googlemail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: array handles and non-local exits
Date: Wed, 17 Sep 2008 21:32:25 +0200	[thread overview]
Message-ID: <49dd78620809171232n745ac8ecgd2c3936989ce723b@mail.gmail.com> (raw)
In-Reply-To: <87ljxsv80p.fsf@gnu.org>

2008/9/16 Ludovic Courtès <ludo@gnu.org>:
>
> 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_dynwind_end ();
>  scm_array_release_handle ();
>
> Perhaps that's what is implied by the manual's wording but I find it a
> bit tricky.

Yes, that definitely is what the manual means by "properly nested" -
but I also agree that it is a bit tricky.

>>> 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 plenty of functions that do
> `dynwind_begin' + `dynwind_end').

Yes, I see what you mean now.  (The scm_dynwind_begin() being in
scm_array_get_handle(), and the scm_dynwind_end() being in
scm_array_release_handle().)

>> I think you're imagining a clear boundary here where there isn't one.
>> If needed, either the scm_dynwind would be inside
>> scm_array_get_handle, or it would be inside scm_uniform_vector_read.
>> Both of those are public libguile functions, so where's the
>> difference?
>
> The difference is that `scm_array_get_handle ()' is a low-level
> function.  It may be used, say, in code that passes SRFI-4 vectors to C
> that implements "performance-critical" code.  Adding consing in there
> wouldn't feel right.

If you add in " and which can't possibly do a non-local exit " there,
I see your point.

> Right, I hadn't thought about it, but as you mention, a dynwind in
> `uniform-vector-read!' will only affect soft port implementations.

With that in mind, do you think we need to solve this now?  I think
this is low impact, so for now I'm inclined just to raise a bug in
Savannah, containing our discussion so far, so that we don't forget
it.

Regards,
        Neil




  reply	other threads:[~2008-09-17 19:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-15 20:17 array handles and non-local exits Neil Jerram
2008-09-16  7:56 ` Ludovic Courtès
2008-09-17 19:32   ` Neil Jerram [this message]
2008-09-18  8:15     ` Ludovic Courtès
2008-09-18  9:17       ` Neil Jerram
2008-09-18 13:44         ` Ludovic Courtès
2009-06-30 22:59           ` Neil Jerram
2009-07-01  8:37             ` Ludovic Courtès
2009-07-01 22:04               ` Neil Jerram
2009-07-01 22:36                 ` Ludovic Courtès
2009-07-02 23:33                   ` Neil Jerram
2009-07-03 23:38                     ` Neil Jerram
2009-07-04 19:28         ` Andy Wingo
2009-07-05 11:14           ` Ludovic Courtès
2009-07-06 14:09             ` Andy Wingo
2009-07-06 20:30               ` Ludovic Courtès
2009-07-09 19:19                 ` Andy Wingo
2009-07-09 21:08                   ` Ludovic Courtès
2009-07-10 10:27                     ` Andy Wingo
2009-07-10 12:05                       ` Ludovic Courtès
2009-07-19 20:04                         ` Neil Jerram
2009-07-20  9:20                           ` Ludovic Courtès
2009-07-23 21:20                             ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49dd78620809171232n745ac8ecgd2c3936989ce723b@mail.gmail.com \
    --to=neiljerram@googlemail.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).