unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Linas Vepstas <linasvepstas@gmail.com>
To: Neil Jerram <neil@ossau.uklinux.net>
Cc: Guile User <guile-user@gnu.org>
Subject: Re: continuation barriers
Date: Fri, 28 Aug 2009 16:42:15 -0500	[thread overview]
Message-ID: <3ae3aa420908281442la9cb7a6k2471ddf542e8165f@mail.gmail.com> (raw)
In-Reply-To: <87y6p6nu9e.fsf@arudy.ossau.uklinux.net>

Hi Neil,

2009/8/26 Neil Jerram <neil@ossau.uklinux.net>:
> Linas Vepstas <linasvepstas@gmail.com> writes:
>
>> i.e. I'd like something like this to work:
>>
>> scm_c_eval_string(" ... (call/cc (lambda (k) (set! *myk* k))) ...");
>> ... some_c_code(...);
>> scm_c_eval_string(" ... (*myk* 42) ...");
>
> I think there are a couple of problems here.
>
> The first is as you've noted, that scm_c_eval_string() has a
> scm_c_with_continuation_barrier() hiding inside it.

I mis-spoke or mis-implied -- the thing holding the continuation
barrier is scm_with_guile().  There may also be one within
scm_c_eval_str() although I did not immediately spot it.

> You can avoid
> that by using some other method for calling from C into Scheme, for
> example:

What you described would seem to work, except that what I really
need is a a variant of scm_with_guile() without the continuation
barrier.   Or rather, a variant of scm_with_guile() which uses a
continuation barrier only if the stack underneath is *different*
than what it was when the continuation was defined.  (Right?
since if the stack is the same, using the continuation can't
mess up the stack.)

I think that what I suggest is straightforward to code up: and
I think its safe.  Would anyone care for a patch against 1.9.2 or
1.9.3 or whatever?

--linas




      parent reply	other threads:[~2009-08-28 21:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-23 20:19 continuation barriers Linas Vepstas
2009-08-26 21:24 ` Neil Jerram
2009-08-28 15:41   ` Linas Vepstas
2009-08-28 21:42   ` Linas Vepstas [this message]

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=3ae3aa420908281442la9cb7a6k2471ddf542e8165f@mail.gmail.com \
    --to=linasvepstas@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=neil@ossau.uklinux.net \
    /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).