guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile Impressions


From: Rob Browning
Subject: Re: Guile Impressions
Date: 11 May 2001 00:08:25 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

John Fitzgerald <address@hidden> writes:

> Thanks.  Where will these eventually sit in the Guile documentation?

Good question.

> So what do I make of a C function which is supposed to take a
> closure as an argument (e.g., scm_boot_guile())?

Dunno, since I've never used it.  It might also be using
"continuation" in some looser context.

> Have you ever had reason to use continuations in production code?

Yep.

I have used them in the past for:

  (1) implementing a threading system in a scheme implementation that
      didn't have threads.

  (2) and (I seem to recall) as an exceptions-style mechanism in a
      scheme implementation that didn't have exceptions.

They can also be used to implement operations like dynamic-wind.

There are also less infrastructure-esque uses for them.  In
particular, they can be used, when you don't have (or want for some
reason) threads, parallel or incremental searches.

You can keep track of where you are in the computation (perhaps in
multiple places) just by capturing a continuation at each of those
places, and then calling it later when you want to pick up where you
left off.

However, all that said.  call/cc and it's continuations are really the
wrecking ball of control constructs -- sweepingly powerful and
extremely useful when needed, but most of the time, you just need a
hammer :>

-- 
Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930



reply via email to

[Prev in Thread] Current Thread [Next in Thread]