Simple overloading without complications

Lodovico Giaretta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 12 09:50:41 PDT 2016


On Tuesday, 12 July 2016 at 16:27:52 UTC, Adam Sansier wrote:
> On Tuesday, 12 July 2016 at 13:54:16 UTC, Lodovico Giaretta
>> Also note that yield semantics as available in various 
>> languages is much different from what you are proposing here.
>
> Not really. Yield is usually a break in flow, regardless just 
> because it's applied to fibers doesn't mean it's *much* 
> different. It's the same basic concept.

Across various programming languages, yield has two very 
different meanings and aims:
1) to achieve cooperative multitasking (as in D fibers); but you 
are not doing cooperative multitasking;
2) for generator functions (like in Python); but you don't have a 
function that generates multiple values.

Also note that in both cases the yielding does not depend on some 
syntax used at call site.

So, by any PL meaning of yield, yield is not what you need to 
solve your problem.


More information about the Digitalmars-d-learn mailing list