comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: Re: Mariner 1 / FORTRAN bug
Date: Fri, 9 Aug 2019 09:27:22 -0500
Date: 2019-08-09T09:27:22-05:00	[thread overview]
Message-ID: <qijvs9$11g4$1@gioia.aioe.org> (raw)
In-Reply-To: 011db4d7-3455-407d-9a1d-aa747d35c538@googlegroups.com

On 8/9/2019 3:38 AM, Maciej Sobczak wrote:
>> But outside of mathematical formulas, can you give an example of
>> single-character error in Ada?
> 
> with Ada.Text_IO;
> 
> procedure Test is
> 
>     procedure P (I, J : Integer) is
>     begin
>        Ada.Text_IO.Put_Line ("Killing people");
>     end;
> 
>     procedure P (f : Float) is
>     begin
>        Ada.Text_IO.Put_Line ("Not killing people");
>     end;
> 
> begin
>     P (1,2); -- or should it be P (1.2); ?
> end;
> 
> And of course we have to implement the Initialise operation for our Controlled types, right?
> 

That is why using named arguments is better and also more clear

    P (I=>1, J=>2);

No chance to mix it up with

    P (f=>1.2);

--Nasser

  reply	other threads:[~2019-08-09 14:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-12-04 20:18 C++ vs. Ada -- Is Ada loosing? happy.colorado.edu!srheintze
2019-08-08 15:23 ` robin.vowels
2019-08-12 15:47   ` Shark8
2019-08-08 15:40 ` Marina 1 / FORTRAN bug robin.vowels
2019-08-08 17:26   ` Mariner " Jeffrey R. Carter
2019-08-09  1:57     ` robin.vowels
2019-08-09  6:28       ` J-P. Rosen
2019-08-09  6:47         ` Niklas Holsti
2019-08-09 11:40           ` J-P. Rosen
2019-08-09 15:57           ` Jeffrey R. Carter
2019-08-09  8:38         ` Maciej Sobczak
2019-08-09 14:27           ` Nasser M. Abbasi [this message]
2019-08-09 21:05             ` Maciej Sobczak
2019-08-09 21:24               ` Lucretia
2019-08-09 22:03                 ` Paul Rubin
2019-08-08 17:51   ` Keith Thompson
replies disabled

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