From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4e39e3650a0d633 X-Google-Attributes: gid103376,public From: Ehud Lamm Subject: Re: Icon Co-Expressions in Ada Date: 1998/12/17 Message-ID: #1/1 X-Deja-AN: 423346236 References: <36794F71.762920E4@elca-matrix.ch> Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: The hebrew University of Jerusalem Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-12-17T00:00:00+00:00 List-Id: On Thu, 17 Dec 1998, Mats Weber wrote: > Ehud Lamm wrote: > > > For this to work from arbitrary procedures, the language provides the > > suspend statement, which is like return but after which the procedure may > > be resumed.(you can have a procedure say suspend 4; suspend 5; for > > example). > > This sounds like coroutines in other languages. The closest Ada has to > offer is tasks, but as Ada tasks can be called concurrently, you will > have a significant overhead over a simple coroutine mechanism. > See my post about Co-Expressions and goal directed evaluation in general. The concepts are near but not identical. You can have generators (that is, routines that use suspend and return a series of values) without using Co-Expressions. I think Co-Expressions are what others call co-routines, but I am not 100% sure. About the overhead. Can we design something less costly using protected objects? Ehud Lamm mslamm@mscc.huji.ac.il http://www2.cybercities.com/e/ehud E-List Home Page