[Ecls-list] RESTART-CASE in C (please comment)

Matthew Mondor mm_lists at pulsar-zone.net
Tue Jul 3 17:34:47 UTC 2012


On Mon, 2 Jul 2012 23:24:10 +0200
Juan Jose Garcia-Ripoll <juanjose.garciaripoll at gmail.com> wrote:

> I have managed to code a couple of macros that do the equivalent of
> RESTART-CASE in C. I believe the same thing can be done for HANDLER-CASE.
> Could you guys have a look at the manual and tell me whether it looks fine
> for regular use?
> 
> http://ecls.sourceforge.net/new-manual/ (under I.6 Conditions)

After thinking about it a bit, I think that it's hard to do anything
better for C, especially for inline code.

Perhaps that it'd be possible for <n> to be handled automatically from
the macro such that it's not necessary to specify it, I'm not sure if
it makes sense.  The interface seems usable.

I also noticed the similar handler-case related macros but I've not
seen them in the conditions dictionary.


I noticed that there's an extra { in the documentation synopsis:

ECL_RESTART_CASE_BEGIN(env,names) {

} ECL_RESTART_CASE(n,args) { {

} ECL_RESTART_CASE_END;

Is it voluntary to describe that multiple such clauses can exist?  An
alternative might be:

ECL_RESTART_CASE_BEGIN(env, names) {

} ECL_RESTART_CASE(n, args) {
[...]

} ECL_RESTART_CASE_END;

Perhaps that there should be something mentioned about the env
argument, and that a few spaces could cleanup the example code
slightly...

Thanks,
-- 
Matt




More information about the ecl-devel mailing list