comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: pragma Pure (Ada)
Date: Sun, 09 Oct 2011 08:34:51 +0200
Date: 2011-10-09T08:34:51+02:00	[thread overview]
Message-ID: <9fctjdFcvgU1@mid.individual.net> (raw)
In-Reply-To: <op.v211w2a2ule2fv@index.ici>

On 11-10-09 00:54 , Yannick Duchêne (Hibou57) wrote:
> Le Sat, 08 Oct 2011 03:37:53 +0200, Adam Beneschan <adam@irvine.com> a
> écrit:
>> So a special rule had to be added to make the language *prefer* the
>> "universal access" equality function over any other function.
>>
>> Hope this helps,
> Yes Adam, that help, but raise another question: the choice of the
> anonymous access type operator is surprising to me. Why was the choice
> of the more specific operator rejected ?

There can be several different such "more specific" operators, when 
there are possible implicit conversions of the anonymous access type to 
several named access type. Which "more specific" operator should be chosen?

> ...the choice of the least specific operator, is
> counterintuitive, and unintuitive things may lead to bad surprised and
> unexpected behavior (an an error at compile time is always preferable to
> an unexpected behavior).

The choice of the least specific operator minimizes the number of 
implicit type conversions, which in my view is good. But I would, 
perhaps, like to have a compiler switch to warn me when this preference 
rule is applied, especially if the non-preferred implicit conversions 
could reach an operator that is not the predefined operator for its type.


-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .



  reply	other threads:[~2011-10-09  6:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-01  1:50 pragma Pure (Ada) Yannick Duchêne (Hibou57)
2011-10-01  2:11 ` Yannick Duchêne (Hibou57)
2011-10-08  1:37   ` Adam Beneschan
2011-10-08 22:54     ` Yannick Duchêne (Hibou57)
2011-10-09  6:34       ` Niklas Holsti [this message]
2011-10-10 15:06       ` Adam Beneschan
2011-10-01  2:28 ` Yannick Duchêne (Hibou57)
2011-10-08  1:08   ` Randy Brukardt
2011-10-08 23:00     ` Yannick Duchêne (Hibou57)
2011-10-01  3:09 ` Adam Beneschan
replies disabled

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