unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Export scm_i_with_continuation_barrier?
@ 2014-02-19  6:38 Doug Evans
  2014-02-20 22:42 ` Mark H Weaver
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2014-02-19  6:38 UTC (permalink / raw)
  To: guile-devel

I realize the _i_ will have to be replaced, and the name
scm_c_with_continuation_barrier is already taken, however,
I found in writing gdb/guile/scm-safe-call.c that
scm_i_with_continuation_barrier is exactly what I need.  Since it's
not available I had to do two levels of calls where one should
suffice.

Here's what I'd like:

scm_foo_with_continuation_barrier (
  my_body, &body_data,
  my_handler, &handler_data,
  my_pre_unwind_handler, &pre_unwind_handler_data);

Since I don't have that I have to do something more complicated.
I'm currently experimenting with
scm_with_guile -> scm_c_with_continuation_barrier -> scm_c_catch.

[what's currently checked into the gdb tree is a work in progress.
blech - I thought I had resolved this but I can see I'm lacking any
continuation barriers]

The current scm_c_with_continuation_barrier is nasty because it uses
continuations.c:pre_unwind_handler which will print the exception ...
but I don't want Guile to print the exception - I want to control
if/when it's printed.  I also don't want continuations.c:c_handler - I
don't want a throw of 'quit to terminate gdb.

What I want is all the functionality of scm_c_catch and all the
functionality of scm_c_with_continuation_barrier ... which is exactly
what scm_i_with_continuation_barrier is.

So ... any chance in exporting scm_i_with_continuation_barrier?
[renamed of course :-)]
How about scm_c_catch_with_continuation_barrier?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Export scm_i_with_continuation_barrier?
  2014-02-19  6:38 Export scm_i_with_continuation_barrier? Doug Evans
@ 2014-02-20 22:42 ` Mark H Weaver
  2014-02-22  6:28   ` Doug Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Mark H Weaver @ 2014-02-20 22:42 UTC (permalink / raw)
  To: Doug Evans; +Cc: guile-devel

Doug Evans <xdje42@gmail.com> writes:

> What I want is all the functionality of scm_c_catch and all the
> functionality of scm_c_with_continuation_barrier ... which is exactly
> what scm_i_with_continuation_barrier is.
>
> So ... any chance in exporting scm_i_with_continuation_barrier?
> [renamed of course :-)]
> How about scm_c_catch_with_continuation_barrier?

FWIW, I think this is a fine idea.  I haven't looked closely enough to
have an opinion about the name, but I'll leave that for others to hash
out, or your best judgment if no one else chimes in.

One thing: if we export it, we should also document it.

Would you like to prepare a patch for stable-2.0?

    Thanks!
      Mark



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Export scm_i_with_continuation_barrier?
  2014-02-20 22:42 ` Mark H Weaver
@ 2014-02-22  6:28   ` Doug Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2014-02-22  6:28 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guile-devel

On Thu, Feb 20, 2014 at 2:42 PM, Mark H Weaver <mhw@netris.org> wrote:
> Doug Evans <xdje42@gmail.com> writes:
>
>> What I want is all the functionality of scm_c_catch and all the
>> functionality of scm_c_with_continuation_barrier ... which is exactly
>> what scm_i_with_continuation_barrier is.
>>
>> So ... any chance in exporting scm_i_with_continuation_barrier?
>> [renamed of course :-)]
>> How about scm_c_catch_with_continuation_barrier?
>
> FWIW, I think this is a fine idea.  I haven't looked closely enough to
> have an opinion about the name, but I'll leave that for others to hash
> out, or your best judgment if no one else chimes in.
>
> One thing: if we export it, we should also document it.
>
> Would you like to prepare a patch for stable-2.0?

I was going to send this earlier, but better late than never.
I looked into implementing this and then I discovered why I'm not
currently using scm_c_with_continuation_barrier:
scm_with_guile already calls it.

So for my current purposes I don't need an exported
scm_i_with_continuation_barrier.
I still think it's a reasonable thing to do, but the need isn't pressing.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-22  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-19  6:38 Export scm_i_with_continuation_barrier? Doug Evans
2014-02-20 22:42 ` Mark H Weaver
2014-02-22  6:28   ` Doug Evans

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).