non-local exits are icky Tom Lord (23 Dec 2003 23:07 UTC)
Re: non-local exits are icky Michael Sperber (26 Dec 2003 15:41 UTC)
Re: non-local exits are icky Tom Lord (26 Dec 2003 18:14 UTC)
Re: non-local exits are icky Michael Sperber (26 Dec 2003 18:30 UTC)
Re: non-local exits are icky Tom Lord (26 Dec 2003 19:19 UTC)
Re: non-local exits are icky Michael Sperber (27 Dec 2003 16:16 UTC)
Re: non-local exits are icky Tom Lord (27 Dec 2003 18:38 UTC)
Re: non-local exits are icky Michael Sperber (27 Dec 2003 18:43 UTC)

Re: non-local exits are icky Tom Lord 26 Dec 2003 19:43 UTC

    > From: Michael Sperber <xxxxxx@informatik.uni-tuebingen.de>

    > Tom> The SRFI is slightly unclear but I understand the section
    > Tom> "Signalling errors from external code" to mean that a call
    > Tom> to something like SCHEME_ARGUMENT_TYPE_ERROR does not
    > Tom> return to its caller, but rather directly to Scheme.

    > Tom> I gather also that SCHEME_CALL may result in a non-local
    > Tom> exit past the caller.

    > Correct.

    > Tom> Since the mechanism of these non-local exits is not
    > Tom> specified and can not be modified by C code, the FFI
    > Tom> contains no provision for them to perform unwind protection
    > Tom> --- that's a serious omission.

    > But SCHEME_CALL takes you back to Scheme, where you can use
    > DYNAMIC-WIND.

    > I think I misunderstand your point.

A sketch that illustrates the issue:

  my_fn ()
  {
    int fd;

    fd = open ("somefile", O_RDONLY, 0);

    SCHEME_CALL ( [...] );

    close (fd);
  }

-t