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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,9e7db243dfa070d7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!85.158.31.10.MISMATCH!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 30 Oct 2010 21:20:04 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Do people who use Ada also use ocaml or F#? References: <87ocab3mir.fsf@mid.deneb.enyo.de> <8j2nesF7crU1@mid.individual.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4ccc6fe4$0$6992$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 30 Oct 2010 21:20:04 CEST NNTP-Posting-Host: 4c78ffa1.newsspool4.arcor-online.net X-Trace: DXC=n9JQLnMW6<4^cW`WBF>WQ<4IUKejV8;Bi1XSQ]b49<5blW?b=@i; X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:15954 Date: 2010-10-30T21:20:04+02:00 List-Id: On 10/30/10 8:58 PM, Yannick DuchĂȘne (Hibou57) wrote: > Le Sat, 30 Oct 2010 16:12:44 +0200, Niklas Holsti a Ă©crit: >> I hesitate to say so, Yannick, but what you say above makes we wonder if you really know what sort of "yield" is proposed for Ada 2012. As I understand the proposed Ada 2012 Yield procedures, they are meant for low-level control of task scheduling > Oops, not the Yield I know :( > Sorry everyones for the Oops (doubly disappointed) > > (seems I miss-understood Randy when he talked about this Yield some days ago) > For programming an "'incremental' return statement", as Niklas Holsti has put it, I find the original, 30 years old "architectural" notion of task quite well suited. Forget about number of processors, task switching, or anything "heavy" for a moment. Let a task just be some sequential process that computes something incrementally. The task object accepts calls whenever it is ready to deliver another result. Call this result the yield, the result that the task has most recently generated: task type Generator is entry Element (Result : out T); end Generator; task body Generator is Data : array (Data_Index) of T; begin for K in Data'Range loop Compute (Data, K); select accept Element (Result : out T) do Result := Data(K); end Element; or terminate; end select; end loop; end Generator;