|
From: | Philipp Stephani |
Subject: | Re: Dynamic loading progress |
Date: | Sun, 04 Oct 2015 17:48:24 +0000 |
> 3) How exactly do we represent catch/throw values?
>
>
> I've thought about this a bit, and I think it would be simplest to add a
> new function env->set_throw and have get_error and check_error return an
> enum { normal, signal, throw }. One could come up with something like
> creating a list (error-kind error-tag error-value), but it looks like
> the module implementation would create such lists only for the module
> code to convert them back, so it's simpler to represent the two kinds of
> non-local exits directly in the interface.
I'm fine with a list; keep in mind that we'll need to handle OOM
somehow, so I'd suggest an opaque type.I think OOM is currently handled by doing the equivalent of(apply #'signal memory-signal-data)so it would be part of the normal signal handling. Using a list would be possible, but then the distinction between error tag and data could be removed from the module code. But I think the 'magic lists' idiom common in Emacs is more of an antipattern and we should try to avoid it in the module interface, thus the suggestion to use an enum.
[Prev in Thread] | Current Thread | [Next in Thread] |