GNU bug report logs -
#20938
make-dynamic-state, with-dynamic-state & exceptions
Previous Next
Full log
View this message in rfc822 format
El 24/06/16 a les 09:11, Andy Wingo ha escrit:
> On Tue 30 Jun 2015 15:50, Josep Portella Florit <jpf <at> 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)`.
This bug report was last modified 8 years and 135 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.