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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Mixing operators and dot notation Date: Mon, 6 Jun 2016 15:58:12 +0200 Organization: A noiseless patient Spider Message-ID: References: <03122e74-1f33-4a94-9d38-ea0dbe3f7658@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 6 Jun 2016 13:58:13 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="df6c13c4617621ca1de5ec657b563bf1"; logging-data="2565"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186JYw6wigoAflQVV4LxpJK" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <03122e74-1f33-4a94-9d38-ea0dbe3f7658@googlegroups.com> Cancel-Lock: sha1:RkdzTzNneP1Uk/tpvr0ZPc7wFdk= Xref: news.eternal-september.org comp.lang.ada:30635 Date: 2016-06-06T15:58:12+02:00 List-Id: On 06/06/16 10:10, briot.emmanuel@gmail.com wrote: >> To give you the essence. I'm back to trying to get a minimal ReactiveX >> (http://reactivex.io)-like thing working. The gist is that you can chain >> many transformation operations: >> >> SourceType.Generate_Data >> .Op1 (...) >> ... >> .OpN (...) >> .Endpoint (Operate_With_Resulting_Transformed_Data); > > > Funny, I have been playing with exactly the same purpose recently > although I only started from the promises pattern, which I am now > extending. > > https://github.com/briot/Ada-promises Noted. > > I had exactly the same problems you had, and copy with using operators, > so my current syntax is: > > Get_Promise > and new Op1 > and (new Op2 & new Op3) > and new Endpoint; > > (using tagged types for the operations). That's because things need to be > type safe as well, so the operations are declared in generic packages, > and therefore we can't use the dot notation here. I believe there could be > some extension to the language here. Talk about serendipity. Just last night I arrived at a solution I find satisfactory, and I see it's basically the same as yours (using "&" instead). From a cursory glance at your Ada-promises site I see that we had the same thinking about lambda functions too. My RxAda outline is here: https://bitbucket.org/amosteo/rxada/ Álex. > > Emmanuel >