guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamic-wind


From: Catonano
Subject: Re: dynamic-wind
Date: Wed, 5 Jul 2017 08:14:38 +0200

Chris,

thank you for your remarks.

Yo're right that I was being caught up by continuations AND that I was
probably missing the generality of the concept of dynamic wind

And yet, I still want to clarify my point

My point is not that the manual is incomplete or inaccurate

My point is that the manual does not a good job of _introducing_ people to
the concept of dynamic wind

Especially people wo have not clear in mind a complete map of the use cases
with relative possible solutions.

The manual tends to be a very good reference for already educated people.
But it's not as good in educating people in the first place, in my view.



2017-07-02 13:58 GMT+02:00 Chris Vine <address@hidden>:

> On Sun, 2 Jul 2017 08:00:58 +0200
> > aahh I see now
> >
> dynamic-wind is much more general than just for dealing with database or
> network connections, which I think would be a poor focus for the manual.
>

I was not suggesting to _narrow_ the focus of the manual

I was suggesting to use a more mundane example as an _introduction_ to the
functionality of dynamic wind

The current example could still be given, maybe as the last one

A general principle for the Wikipedia pages is to use an informal
description first and then move on to more formal discssion later in the
page

To allow both audiences (interested in a quick overview and interested in a
deeper analisys) to be served

So I was thinking that the same principle could be used for the discussion
of dynamic wind

I failed to declare this bakthought of mine, though.

That didn't help clarity.

I asked Amirouche his opinion about this threas and e raised several more
points but he also used this sentence (quoing authorized by Amirouche):

"With that thread, I understand the use case of dynamic wind now."

So he wasn't understanding dynamic wind before Panicz's explaination

That seems to confirm my view that the manual is not a great introduction

That said, Amirouche observed that in his Wiredtiger access layer, a state
depending on the db is created and when leaving the dynamic wind context
that sould be unrolled

When reentering it should be properly reproduced

He also considered taht probably in his case, the oprtions of leaving the
context because of an exception and because of an intentional step should
be treated diferently, as you observed


> Having said all that, dynamic-wind is not the answer to all cases where
> control leaves a block of code non-locally.  It is best suited to cases
> where invocation of a continuation object or the raising of an
> exception fall to be dealt with in the same way, say by releasing a
> resource such as by unlocking a mutex or closing a port.  But that is by
> no means always the case - the invocation of a continuation object is
> usually a deliberate programmatic strategy, whereas the raising of an
> exception is usually not so and instead represents an unexpected
> failure event of some kind in the program.


Wrapping up: I concede that dynamic wind is more general than network or
dbs, and that doesn't even exhaust the whole range of possible cases
(thanks !)

But the manual could be improved nonetheless (unless it is meant to NOT be
a tutorial)

One last note: Amirouche lost this thread in his email client and asked me
to post something so he can recuperate this thread and intervene, perhaps


reply via email to

[Prev in Thread] Current Thread [Next in Thread]