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 X-Received: by 10.182.129.48 with SMTP id nt16mr1524584obb.31.1383767642474; Wed, 06 Nov 2013 11:54:02 -0800 (PST) X-Received: by 10.49.24.175 with SMTP id v15mr132735qef.16.1383767642445; Wed, 06 Nov 2013 11:54:02 -0800 (PST) Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!i2no13894162qav.0!news-out.google.com!9ni14389qaf.0!nntp.google.com!i2no13894128qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Nov 2013 11:54:02 -0800 (PST) In-Reply-To: <19b9cc6b-28a4-45e4-939c-7720ae5666b9@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.161.29.144; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 75.161.29.144 References: <19b9cc6b-28a4-45e4-939c-7720ae5666b9@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8a7f97ef-672e-4930-9502-e1202dd158fd@googlegroups.com> Subject: Re: Question about asynchronous calls From: Shark8 Injection-Date: Wed, 06 Nov 2013 19:54:02 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 3670 Xref: number.nntp.dca.giganews.com comp.lang.ada:183786 Date: 2013-11-06T11:54:02-08:00 List-Id: On Wednesday, November 6, 2013 4:05:44 AM UTC-7, mockturtle wrote: > Dear all, >=20 > I am scheduled to give an introductory talk (45 min) about Ada at the nex= t "Open Source Day" here in Udine. I was thinking about giving an overview= of the language, emphasizing those parts that are unique (or almost unique= ) to Ada, with the objective of making people curious.=20 While it doesn't seem like a big thing: subtypes. It's nice not to have to check results of some-function from obviously-inco= rrect-but-technically-possible values like we have to in C/C++/PHP: Ex: Some_Array'Length returns Natural, I don't have to check for -1 wheneve= r I use it. And that's from all the way back to Ada 83, with Ada 2012 we have subtype-p= redicates and can say the following: -- Refactor to a parent-type for SSN or EID. -- Note SSN is 11 characters long, EIN is 10. Type ID_String is new String with Dynamic_Predicate =3D> ID_String'Length in 10|11; -- SSN format: ###-##-#### Subtype Social_Security_Number is ID_String(1..11) with Dynamic_Predicate =3D> (for all Index in Social_Security_Number'Range =3D> (case Index is when 4|7 =3D> Social_Security_Number(Index) =3D '-', when others =3D> Social_Security_Number(Index) in '0'..'9' ) ); -- EIN format: ##-####### Subtype EIN is ID_String(1..10) with Dynamic_Predicate =3D> (for all Index in EIN'Range =3D> (case Index is when 3 =3D> EIN(Index) =3D '-', when others =3D> EIN(Index) in '0'..'9' ) ); -- A string guaranteed to be an SSN (###-##-####) or EIN (##-#######). Subtype Tax_ID is ID_String with Dynamic_Predicate =3D> (Tax_ID in Social_Security_Number) or (Tax_ID in EIN); > Among other things, I am planning about saying something about the existe= nce of Annex E for distributed systems. =20 >=20 > While reading section "E.4.1. Asynchronous Remote Calls" of our beloved R= M, I got a doubt: as I understand the language does not define any specific= mechanism for getting the "return value" of an asynchronous call; if I wan= t the result back I must implement the "back channel" by myself (e.g., a ca= llback or a polling function of type "are we there yet?" [to be said with c= hildish voice] :-). Am I right? Sorry, I haven't used asynchronous-calls.