comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: choice_expression
Date: Mon, 8 Oct 2012 20:07:20 +0200
Date: 2012-10-08T20:07:20+02:00	[thread overview]
Message-ID: <mlaa9k373ttw.1njbz2ev8744k.dlg@40tude.net> (raw)
In-Reply-To: 7125edff-7211-4bef-a6ea-5bfab84ccf9a@googlegroups.com

On Mon, 8 Oct 2012 10:01:46 -0700 (PDT), Adam Beneschan wrote:

> But
> here's a case (no less obscure than the examples you're providing) that
> isn't obvious:
> 
>    A and B in SOMETHING
> 
> where A and B are Booleans and SOMETHING is a subtype of Boolean or
> something like Array'Range where the array index type is Boolean.  Is this 
> 
>    (A and B) in SOMETHING
> 
> or
> 
>    A and (B in SOMETHING) ?

   not A in B

may mean either

   (not A) in B

 or

   not (A in B)  -- I think this is what Ada syntax does

Lattice operations are ambiguous. In mathematics they use different
notation for the operations Ada conflates. E.g. logical V vs. union U (like
in modular types). Both are denoted as "or" in Ada. It also uses | for U in
other cases. The membership test is conflated with the subset test and with
the subsumption test. All are just "in."

This might impose problems once ranges and tests become proper operations.

> But it's incorrect to say that Ada 83 avoided the problem of users having
> to guess precedence.

Ada found a way to solve the problem.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-10-08 18:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 13:34 choice_expression Maxim Reznik
2012-10-08 14:49 ` choice_expression Adam Beneschan
2012-10-08 15:44   ` choice_expression Maxim Reznik
2012-10-08 17:01     ` choice_expression Adam Beneschan
2012-10-08 18:07       ` Dmitry A. Kazakov [this message]
2012-10-18 21:12     ` choice_expression Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox