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!news.eternal-september.org!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language Date: Tue, 29 Aug 2017 18:01:02 +0200 Organization: A noiseless patient Spider Message-ID: References: <1395655516.524005222.638450.laguest-archeia.com@nntp.aioe.org> <1502382504.2184.6.camel@obry.net> <466561720.524077501.729508.laguest-archeia.com@nntp.aioe.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 29 Aug 2017 15:56:40 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="df107e839db79678a6646489609e305d"; logging-data="18187"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ipSRhJDVkgeeaK1olhtkB" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:oTZBSv9YOAD7bDdNP3Iq9w5ovFs= Xref: news.eternal-september.org comp.lang.ada:47833 Date: 2017-08-29T18:01:02+02:00 List-Id: On 11/08/17 08:24, G.B. wrote: > On 11.08.17 03:31, Randy Brukardt wrote: >> Speaking of evil, anonymous types are evil. Why is it hard to declare a >> record type for this purpose? > > A record is mutable, a tuple isn't meant to be mutable > (i.e., can't update it's components). Also, it is harder > to start from good types and names than to use a continous > improvement process that finds them. > > A tuple language will first let programmers write > > return Integer, Float, > or > -> (Int, Float) > or > int, float function; > > and then let them use these values "generically": anything that > takes an integer and a floating point value will work: > argument pattern matching, or referring to Fst and > Snd component using built-in ".0" and ".1" suffix notation. > It then does not matter whether the integers and FPT values > really are of types (apples, prices) or (oranges, weight)... > > It is convenient. Having used it profusely in matlab, it is indeed convenient, specially paired with things like "~" (ignore one of the returned values). But: > It is prone to logical errors, because it'll make lazy > programmers stop making good use of the type system, i.e. > it eases accidentally mistaking apples for oranges, > or price for weight, IOW make reasonably errors. This. Alex. > > It is, therefore, a very viable scheme of language based > supportbusiness. > > > > OTOH, if (int, float) tuples used in the implementation > of an ADT only, then the convenience might loose some of > the disadvantages of depending on tuples. >