unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Catching
@ 2010-02-22 11:09 Hans Aberg
  2010-02-22 13:22 ` Catching Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Aberg @ 2010-02-22 11:09 UTC (permalink / raw)
  To: guile-user

I seem to not get the catch handler called, when using guile  
interactively. Might you provide a small example? Something like:
(catch 'FOO (throw 'FOO "Test") (lambda (x . xt) (display x) (display  
" . ") (display xt)))
(catch #t (throw 'FOO "Test") (lambda (x . xt) (display x) (display  
" . ") (display xt)))

   Hans






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

* Re: Catching
  2010-02-22 11:09 Catching Hans Aberg
@ 2010-02-22 13:22 ` Ludovic Courtès
  2010-02-22 13:50   ` Catching Hans Aberg
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2010-02-22 13:22 UTC (permalink / raw)
  To: Hans Aberg; +Cc: guile-user

Hi,

Hans Aberg <haberg@math.su.se> writes:

> I seem to not get the catch handler called, when using guile
> interactively. Might you provide a small example? Something like:
> (catch 'FOO (throw 'FOO "Test") (lambda (x . xt) (display x) (display
> " . ") (display xt)))

The second argument of ‘catch’ should be a thunk (a zero-argument
procedure):

  (catch 'FOO
    (lambda ()
      (throw 'FOO "test"))
    (lambda (key . args)
      (display args)))

Thanks,
Ludo’.




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

* Re: Catching
  2010-02-22 13:22 ` Catching Ludovic Courtès
@ 2010-02-22 13:50   ` Hans Aberg
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Aberg @ 2010-02-22 13:50 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

On 22 Feb 2010, at 14:22, Ludovic Courtès wrote:

>> I seem to not get the catch handler called, when using guile
>> interactively. Might you provide a small example? Something like:
>> (catch 'FOO (throw 'FOO "Test") (lambda (x . xt) (display x) (display
>> " . ") (display xt)))
>
> The second argument of ‘catch’ should be a thunk (a zero-argument
> procedure):
>
>  (catch 'FOO
>    (lambda ()
>      (throw 'FOO "test"))
>    (lambda (key . args)
>      (display args)))

Yes, sure. Thank you!

   Hans






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

end of thread, other threads:[~2010-02-22 13:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 11:09 Catching Hans Aberg
2010-02-22 13:22 ` Catching Ludovic Courtès
2010-02-22 13:50   ` Catching Hans Aberg

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