« Return to Thread: Please comment! setup_call_cleanup/3 draft.

Re: Please comment! setup_call_cleanup/3 draft.

by Bart Demoen-2 :: Rate this Message:

Reply to Author | View in Thread


Hi all,

I am sorry that I can't be in Pasadena, and I appreciate that there
has been an effort to clean up the specification of
setup_call_cleanup/3 - however ...

Can this document be corrected by someone native english please ?
I am really at a loss interpreting some of the sentences.

> Failure of Cleanup is ignored

This makes no sense - ignoring a failure means what ?
[I have insisted on clarifiaction of this sentence before, but it
remains the same - does noone have a problem with it ?]


> as soon as the goal has completed execution.

How soon ? What is "as soon as" ? And what is "goal has completed
execution" ? Say

           p :- q.
           q :- r.
           r :- s.
           s.

The goal being p.
Has it finished between the q and the dot behind it ?
or between the r and the subsequent . ?
...


in the Note
> A processor receiving interrupts between resource allocation and
> call_cleanup/2 is unable to free the resource timely.

This is nonsense or it makes a lot of hidden assumptions.


> Setup is executed protected from interrupts.

Is there a standard (ISO) meaning of "executed protected from
interrupts" - if not, specify. If so, reference the appropriate
section.

> without leaving an effect
???

> with the cleanup handler present
???

> is called exactly once in one of the following moments

Maybe "at" instead of "in" ?
But what follows the previous sentence in the doc, does not specify by
any means a "moment", rather an interval; and "up to the failing of
Goal" is not specified (unless I missed something elsewhere).


> a throw/1 ... whose matching catch/3 is above Goal

What if the Goal is something like the conjunction

        true, catch(...)

is this catch/3 matching the throw ? does 2. apply ?


> the "ball" of throw/1 will be passed

I looked up all meanings of 'passed' and none seems to match what is
meant.


> As a consequence, the "ball" of Cleanup is lost

The meaning of a "ball" being "lost" is not even remotely and/or
intuitively clear - please remove the NOTE



# Cleanup shares bindings and variables with Setup, Goal and the
# continuation. The bindings of Setup are always present.

I hope not always - for instance on backtracking ?

# No further bindings are present in c2 and the latest moment of
# c1.

"latest moment of" a paragraph in the standard ?


I must admit that I have a bias towards ridiculing any attempt to
specify this cleanup mechanism, but please let your specification
attempt not be weakened by that. I am really looking forward to a
serious specification.

I doubt it is possible (just like any attempt to specify compare/3 for
variables was eventually abandoned), but let my opinion not put a
damper on your optimism :-)

Cheers

Bart


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

 « Return to Thread: Please comment! setup_call_cleanup/3 draft.