Re: C# iterators and suspend/resume in Simula 67

From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 02/20/04


Date: Thu, 19 Feb 2004 21:38:27 -0500

Not sure I follow that. C# has a yield statement?
I think if you want to schedule your own methods, you might look into
Fibers.

-- 
William Stacey, MVP
"Jiri Kripac" <jiri.kripac@autodesk.com> wrote in message
news:uxm72i19DHA.3820@tk2msftngp13.phx.gbl...
> Languages such as Simula 67 contain a general concept of coroutines that
> allow the execution of a method to be suspended without rolling back the
> stack and then later resumed at the same place as it has been suspended.
>
> The C# iterators seem to be a special case of this general suspend/resume
> concept. The "yield" statement suspends the execution of the current
method
> and calling MoveNext() resumes it.
>
> I think it would be cleaner to introduce the general suspend/resume
concept
> to C# and then implement C# iterators on top of this general foundation.
The
> way C# iterators have been added to C# seems to be somewhat ad hoc; it is
a
> very specific and distinct functionality that does not naturally blend
with
> the rest of the language.
>
> Jiri
>
>


Relevant Pages

  • Re: C# iterators and suspend/resume in Simula 67
    ... > Languages such as Simula 67 contain a general concept of coroutines that ... > The C# iterators seem to be a special case of this general suspend/resume ... > I think it would be cleaner to introduce the general suspend/resume ... main problem is finding a real use outside of iteration where coroutines ...
    (microsoft.public.dotnet.languages.csharp)
  • C# iterators and suspend/resume in Simula 67
    ... Languages such as Simula 67 contain a general concept of coroutines that ... The C# iterators seem to be a special case of this general suspend/resume ... The "yield" statement suspends the execution of the current method ... I think it would be cleaner to introduce the general suspend/resume concept ...
    (microsoft.public.dotnet.languages.csharp)