Boost logo

Boost :

Subject: Re: [boost] [coroutine][review] Very Late Review
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2012-09-19 15:41:39


On Wed, Sep 19, 2012 at 7:58 PM, Vicente J. Botet Escriba <
vicente.botet_at_[hidden]> wrote:

> Le 19/09/12 18:21, Giovanni Piero Deretta a écrit :
>
> On Wed, Sep 19, 2012 at 2:20 AM, Vicente J. Botet Escriba <
>> vicente.botet_at_[hidden]> wrote:
>>
>> Hi,
>>>
>>> I didn't know that Oliver was for the thread specific object design.
>>>
>>> I'm not sure the alternative I proposed is the best one. Compile type
>>> safety is too important to be lost. Unfortunately I don't have a solution
>>> that is type safe and that avoid to pass an additional parameter to the
>>> coroutine function.
>>>
>>> Why do you feel it is important not to pass the additional parameter?
>>
> I don't know which will be the good interface to provide coroutines by the
> language itself, but I think that there will not have such a parameter. I
> wanted to be as close as possible to this hypothetic interface. The same
> reason was the origin of the bind suggestion.
>

I do not think it follows. Consider that:
    - most of the languages with with coroutines/generators are dynamically
typed (python, lua), so all coroutine are of the same type: no type
mismatch. Still, those with callcc (scheme, ruby) explicity pass the
continuation to the callee.
    - many languages only allow yielding from the coroutine-fn itself (i.e.
are stackless), so the compiler can figure out the correct signature (C#,
F#)
    - many modern functional languages have delimited continuations, whose
shift and reset operators explicitly pass around the continuation object.

-- gpd


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk