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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Lightweight tasks to implement co-routines? Date: Mon, 31 Jul 2017 21:08:32 +0300 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: qrWnZLr+FAc2xoElQM2hng.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.14.10 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:47530 Date: 2017-07-31T21:08:32+03:00 List-Id: This is a question primarily to Dmitry A. Kazakov who (if I don't mistake) proposed using lightweight tasks for co-routines. I do not quite understand how exactly it should be done: A task may contain several accepts with different names, but a co-routine can contain only one type of entry and it is always with one variable with "out" type (more conveniently represented as a function). So should we standardize that tasks which serve as co-routines should have entries with the same name only? Isn't it more convenient to make them like "yield" keyword in Python? We can for example require that all accepts have the name Yield and one out argument. (However, see above about using functions instead.) If we so much modify the task API for implementing co-routines, isn't it lost the sense to use task API for this at all? For me it seems that we should instead go Python way and implement it as special functions with some kind of "yield" operator. What is the opinion of these who understand? -- Victor Porton - http://portonvictor.org