From: Josep Portella Florit <jpf@primfilat.com>
To: Andy Wingo <wingo@pobox.com>
Cc: 20938@debbugs.gnu.org
Subject: bug#20938: make-dynamic-state, with-dynamic-state & exceptions
Date: Fri, 24 Jun 2016 16:58:58 +0200 [thread overview]
Message-ID: <47514354-2dc0-b945-a1b5-048aa1fe8ef6@primfilat.com> (raw)
In-Reply-To: <87wplfhxhq.fsf@pobox.com>
El 24/06/16 a les 09:11, Andy Wingo ha escrit:
> On Tue 30 Jun 2015 15:50, Josep Portella Florit <jpf@primfilat.com> writes:
>
>> This code crashes Guile 2.0.11:
>>
>> (define x (make-dynamic-state))
>> (with-dynamic-state x (lambda () (/ 1 0)))
>
> Related: http://thread.gmane.org/gmane.lisp.guile.devel/16953
>
> How are you using dynamic states?
I have code[1] written in Racket which uses what I think are the
equivalent to Guile's dynamic states: parameterizations.
My code raises exceptions that contain the result of
`(current-parameterization)`[2]. It later handles those exceptions
and passes the parameterization to `call-with-parameterization`[3] in
order to access the value several parameters had before the exception
was raised.
It also accumulates different results of `(current-parameterization)`,
reorders them and for each one it passes the parameterization to
`call-with-parameterization` and calls other code[4].
1: <http://josep-portella.com/en/software/pinaret/>
<http://josep-portella.com/software/pinaret/pinaret-0.9.zip>
2: File `pinaret/runtime.rkt`, procedure `raise-error/params`.
3: File `pinaret/system.rkt`, procedure `generate`.
File `pinaret/runtime.rkt`, procedure `print-error/params`.
4: File `pinaret/base.rkt`, there are many examples here, look for
`(current-parameterization)`.
next prev parent reply other threads:[~2016-06-24 14:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 13:50 bug#20938: make-dynamic-state, with-dynamic-state & exceptions Josep Portella Florit
2015-07-01 6:49 ` bug#20938: Improved workaround Josep Portella Florit
2016-03-13 14:57 ` bug#20938: More information Josep Portella Florit
2016-06-24 7:11 ` bug#20938: make-dynamic-state, with-dynamic-state & exceptions Andy Wingo
2016-06-24 14:58 ` Josep Portella Florit [this message]
2017-02-28 14:17 ` Andy Wingo
[not found] ` <1b66634b-9e69-da86-116a-088eafb383e7@primfilat.com>
2017-03-01 17:30 ` Andy Wingo
2017-03-03 22:15 ` Josep Portella Florit
2017-03-06 19:55 ` Andy Wingo
2017-03-07 20:36 ` Andy Wingo
2017-03-10 22:00 ` Josep Portella Florit
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=47514354-2dc0-b945-a1b5-048aa1fe8ef6@primfilat.com \
--to=jpf@primfilat.com \
--cc=20938@debbugs.gnu.org \
--cc=wingo@pobox.com \
/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).