comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: a new language, designed for safety !
Date: Fri, 06 Jun 2014 21:39:41 +0300
Date: 2014-06-06T21:39:41+03:00	[thread overview]
Message-ID: <bveg7aFc4f7U1@mid.individual.net> (raw)
In-Reply-To: <5391ffa4$0$6611$9b4e6d93@newsspool4.arcor-online.net>

On 14-06-06 20:51 , G.B. wrote:
> On 06.06.14 17:13, Dan'l Miller wrote:
>> If a fatal runtime error due to an unimplemented method (which Ada
>> would catch at compile-time, but Swift & Objective-C would catch only
>> at runtime [ snip ] 
> 
> Since Ada programs may well have "unimplemented methods",   

   [ snip ]

> Because, with regard to dispatching, if an Ada programmer
> decides to use run-time dispatching, then there may well be
> run-time errors. These include calling an undefined primitive
> operation of a tagged type. This is demonstrated below.

I think the error in your example is of a different kind.

> The program fails predictably, even though it does not use
> pointers or tricks.
> 
> $ ./comptime
> 
> raised CONSTRAINT_ERROR : comptime.ada:35 tag check failed
> $
> 
> That's a run-time error, I'd say, stopping the program.

Yes.

> The state of P2.Op being unimplemented is announced in source,
> though, ("abstract") which is different from just absence
> as in Objective-C etc.

This is not the error in your program.

> package Pak is
> 
>    pragma Pure (Pak);
> 
>    package P1 is
>       type A is abstract tagged private;
>       procedure Op (X : in out A) is abstract;
>    private
>       type A is abstract tagged null record;
>    end P1;
> 
>    package P2 is
>       type T is new P1.A with private;
>       overriding procedure Op (X : in out T);
>    private
>       type T is new P1.A with null record;
>    end P2;
> 
>    package P3 is
>       -- Drills a hole!

No.

>       type TA is abstract new P2.T with private;
>       overriding procedure Op (X : in out TA) is abstract;
>    private
>       type TA is abstract new P2.T with null record;
>    end P3;
> 
> end Pak;
> 
> with Pak;
> procedure Comptime
> is
>    Obj : Pak.P2.T;
>    X : Pak.P1.A'Class := Obj;
> begin
>    Pak.P3.TA'Class(X).Op;  -- run-time dispatching

The error, as I understand it, is trying to convert X, which is of a
classwide type covering Pak.P2.T, to a classwide type (Pak.P3.TA'Class)
which does not cover Pak.P2.T. (Apologies if I'm not using the correct
ARM terms for this.) The dispatching call is not the problem.

This error is more similar to a subtype or type conversion error, where
the source value violates the constraints of the target type.

Yes, Ada has run-time errors, but they are not the result of
"unimplemented methods".

An example coming closer to an unimplemented method error would, IMO, be
a run-time dispatch to an operation with two or more controlling
parameters, where the actual parameters have different tags, and there
is no operation for this mixture of tags (of course, as Ada does not
permit such multiple dispatch).

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


  reply	other threads:[~2014-06-06 18:39 UTC|newest]

Thread overview: 285+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03  1:37 a new language, designed for safety ! Nasser M. Abbasi
2014-06-04  0:21 ` Luke A. Guest
2014-06-04  1:19   ` Dan'l Miller
2014-06-04  4:05     ` Dan'l Miller
2014-06-04  6:59       ` Georg Bauhaus
2014-06-04  4:12     ` Dan'l Miller
2014-06-04  5:44   ` Jeffrey Carter
2014-06-04 15:25 ` Dan'l Miller
2014-06-04 19:43   ` Robert A Duff
2014-06-04 21:32     ` Simon Clubley
2014-06-05  9:13     ` Nasser M. Abbasi
2014-06-05 15:33       ` Adam Beneschan
2014-06-05 19:19         ` Jeffrey Carter
2014-06-05 15:55       ` Adam Beneschan
2014-06-05 19:15         ` sbelmont700
2014-06-05 22:40       ` Robert A Duff
2014-06-06 15:13         ` Dan'l Miller
2014-06-06 17:51           ` G.B.
2014-06-06 18:39             ` Niklas Holsti [this message]
2014-06-06 19:43               ` Robert A Duff
2014-06-06 20:42                 ` Dmitry A. Kazakov
2014-06-08  9:40               ` Georg Bauhaus
2014-06-08 13:56                 ` Robert A Duff
2014-06-08 16:13                   ` Dan'l Miller
2014-06-08 17:22                     ` J-P. Rosen
2014-06-08 19:36                     ` Dmitry A. Kazakov
2014-06-09  5:30                       ` Niklas Holsti
2014-06-09  7:06                         ` Dmitry A. Kazakov
2014-06-09 16:07                           ` Dan'l Miller
2014-06-10  7:44                             ` Dmitry A. Kazakov
2014-06-10 16:31                               ` Dan'l Miller
2014-06-10 16:52                                 ` Dmitry A. Kazakov
2014-06-06 18:52           ` Robert A Duff
2014-06-06 22:50             ` Simon Clubley
2014-06-23  0:40       ` Yannick Duchêne (Hibou57)
2014-06-23  0:43         ` Yannick Duchêne (Hibou57)
2014-06-23  0:51           ` Shark8
2014-06-23  1:47             ` Nasser M. Abbasi
2014-06-23  6:46               ` Shark8
2014-06-23 14:17             ` Peter Chapin
2014-06-23 15:39               ` Dan'l Miller
2014-06-23 17:04               ` Dmitry A. Kazakov
2014-06-05  8:26   ` Georg Bauhaus
2014-06-09 10:03 ` Pascal Obry
2014-06-10  9:36   ` Stephen Leake
2014-06-10 10:48     ` Luke A. Guest
2014-06-10 18:31       ` Pascal Obry
2014-06-23  1:01         ` Yannick Duchêne (Hibou57)
2014-06-10 12:28     ` Simon Clubley
2014-06-10 12:42       ` Lucretia
2014-06-10 12:50         ` J-P. Rosen
2014-06-10 13:00           ` Lucretia
2014-06-10 14:43             ` Brad Moore
2014-06-10 15:15               ` J-P. Rosen
2014-06-10 20:28                 ` Simon Clubley
2014-06-10 20:39                   ` Pascal Obry
2014-06-10 21:04                     ` Simon Clubley
2014-06-11  7:17                       ` Pascal Obry
2014-06-25 22:37                         ` Yannick Duchêne (Hibou57)
2014-06-10 22:09                   ` Luke A. Guest
2014-06-12 23:58                     ` Shark8
2014-06-13  1:28                       ` Luke A. Guest
2014-06-25 22:41                         ` Yannick Duchêne (Hibou57)
2014-06-26  1:36                           ` Shark8
2014-06-26 10:19                           ` J-P. Rosen
2014-06-25 22:40                     ` Yannick Duchêne (Hibou57)
2014-06-26  7:39                       ` Luke A. Guest
2014-06-26  7:42                         ` Yannick Duchêne (Hibou57)
2014-06-26 10:07                           ` Luke A. Guest
2014-06-26 10:18                       ` J-P. Rosen
2014-07-02 22:06                         ` Randy Brukardt
2014-06-11  0:16                   ` Jeffrey Carter
2014-06-11  7:29                     ` Simon Clubley
2014-06-11 19:22                       ` Jeffrey Carter
2014-06-12 11:48                         ` Simon Clubley
2014-06-12 16:59                           ` Jeffrey Carter
2014-06-10 15:33               ` Lucretia
2014-06-10 16:31                 ` Dmitry A. Kazakov
2014-06-10 19:34                   ` Tero Koskinen
2014-06-11  6:46                     ` Natasha Kerensikova
2014-06-11  8:45                     ` Dmitry A. Kazakov
2014-06-11  9:05                       ` Simon Wright
2014-06-11 12:09                       ` Simon Clubley
2014-06-11 12:34                         ` Dmitry A. Kazakov
2014-06-11 12:42                           ` björn lundin
2014-06-11 13:04                           ` Lucretia
2014-06-11 12:11                     ` björn lundin
2014-06-10 19:49                 ` J-P. Rosen
2014-06-10 22:09                   ` Luke A. Guest
2014-06-11  9:01                     ` Simon Wright
2014-06-16 16:22                     ` Randy Brukardt
2014-06-16 17:11                       ` Ada platforms and pricing, was: " Simon Clubley
2014-06-17 19:34                         ` Randy Brukardt
2014-06-17 20:16                           ` Jeffrey Carter
2014-06-18  5:56                             ` Georg Bauhaus
2014-06-18  6:34                               ` Nasser M. Abbasi
2014-06-18 19:57                           ` Simon Clubley
2014-06-19  3:46                             ` Randy Brukardt
2014-06-22 19:50                               ` Simon Clubley
2014-06-22 23:38                                 ` Randy Brukardt
2014-06-23  6:18                                   ` Niklas Holsti
2014-06-23  7:42                                     ` Dmitry A. Kazakov
2014-06-23 11:17                                       ` Simon Wright
2014-06-23 17:14                                         ` Dmitry A. Kazakov
2014-06-23 19:21                                           ` Dan'l Miller
2014-06-23 20:14                                             ` Dmitry A. Kazakov
2014-06-23 21:48                                               ` Simon Wright
2014-06-24  1:18                                                 ` Nasser M. Abbasi
2014-06-24  2:15                                                   ` Jeffrey Carter
2014-06-24  7:51                                                 ` Dmitry A. Kazakov
2014-06-23 21:52                                               ` Simon Wright
2014-06-24  1:04                                                 ` Dan'l Miller
2014-06-26  3:24                                               ` Yannick Duchêne (Hibou57)
2014-06-26  3:27                                                 ` Yannick Duchêne (Hibou57)
2014-06-24  1:01                                             ` Shark8
2014-06-24 10:24                                               ` Simon Wright
2014-06-24 11:25                                                 ` Dan'l Miller
2014-06-24 15:55                                                   ` Shark8
2014-06-24 18:06                                                     ` Dan'l Miller
2014-06-24 18:44                                                       ` Dan'l Miller
2014-06-24 18:49                                                       ` Shark8
2014-06-24 21:25                                                         ` Dan'l Miller
2014-06-24 16:48                                                   ` Simon Wright
2014-06-26  3:41                                                   ` Yannick Duchêne (Hibou57)
2014-06-23 20:40                                           ` Simon Wright
2014-06-24  7:48                                             ` Dmitry A. Kazakov
2014-06-23 11:48                                       ` G.B.
2014-06-24  7:52                                       ` Maciej Sobczak
2014-06-24  8:33                                         ` Dmitry A. Kazakov
2014-07-01 10:28                                           ` Simon Wright
2014-07-01 12:41                                             ` Dmitry A. Kazakov
2014-06-26  2:50                                         ` Yannick Duchêne (Hibou57)
2014-06-26 10:04                                           ` G.B.
2014-06-26 18:20                                             ` Yannick Duchêne (Hibou57)
2014-06-25 17:24                                       ` Niklas Holsti
2014-06-26  2:43                                       ` Yannick Duchêne (Hibou57)
2014-06-23  7:31                                   ` Dmitry A. Kazakov
2014-06-23 20:08                                     ` Randy Brukardt
2014-06-23 20:20                                       ` Dmitry A. Kazakov
2014-06-24 11:56                                         ` Simon Clubley
2014-06-24 12:13                                   ` Simon Clubley
2014-06-17 20:27                         ` Luke A. Guest
2014-06-18  7:09                           ` Natasha Kerensikova
2014-06-18 10:32                             ` J-P. Rosen
2014-06-18 11:50                               ` Brian Drummond
2014-06-18 17:34                               ` Natasha Kerensikova
2014-06-18 17:56                                 ` Peter Chapin
2014-06-19  7:22                                   ` Natasha Kerensikova
2014-06-19 12:02                                     ` Peter Chapin
2014-06-20  7:03                                       ` Natasha Kerensikova
2014-06-19 13:33                                     ` Lucretia
2014-06-20  7:07                                       ` Natasha Kerensikova
2014-06-20 11:44                                         ` Lucretia
2014-06-20 12:47                                           ` Dennis Lee Bieber
2014-06-18 18:24                                 ` Lucretia
2014-06-19  7:26                                   ` Natasha Kerensikova
2014-06-18 18:47                                 ` Dmitry A. Kazakov
2014-06-18 20:17                                   ` Simon Clubley
2014-06-18 22:51                                     ` Simon Clubley
2014-06-19  8:51                                       ` Dmitry A. Kazakov
2014-06-19  3:35                                   ` Randy Brukardt
2014-06-19  7:34                                   ` Natasha Kerensikova
2014-06-19  8:19                                     ` J-P. Rosen
2014-06-19  9:11                                     ` Dmitry A. Kazakov
2014-06-19 12:08                                       ` Peter Chapin
2014-06-19 13:48                                         ` Dmitry A. Kazakov
2014-06-19 20:59                                         ` Randy Brukardt
2014-06-26  2:04                                           ` Yannick Duchêne (Hibou57)
2014-06-26 22:24                                             ` Shark8
2014-06-26 22:44                                               ` Yannick Duchêne (Hibou57)
2014-06-26 22:51                                                 ` Shark8
2014-06-27 12:43                                               ` Ada platforms and pricing, was: Re: a new language, anon
2014-06-19 21:13                                         ` Ada platforms and pricing, was: Re: a new language, designed for safety ! Robert A Duff
2014-06-19 23:47                                           ` Adam Beneschan
2014-06-19 21:03                                     ` Randy Brukardt
2014-06-20  7:26                                       ` Natasha Kerensikova
2014-06-20 19:50                                         ` Randy Brukardt
2014-06-21  8:35                                           ` Natasha Kerensikova
2014-06-22 23:26                                             ` Randy Brukardt
2014-06-26  2:16                                             ` Yannick Duchêne (Hibou57)
2014-06-20  9:54                                   ` anon
2014-06-20 12:25                                     ` Lucretia
2014-06-20 19:32                                       ` Ada platforms and pricing, was: Re: a new language, designed for anon
2014-06-18 17:01                             ` Ada platforms and pricing, was: Re: a new language, designed for safety ! Jeffrey Carter
2014-06-19  7:53                               ` Natasha Kerensikova
2014-06-19 21:10                                 ` Randy Brukardt
2014-06-19 22:27                                   ` Luke A. Guest
2014-06-16 21:31                       ` Luke A. Guest
2014-06-16 23:02                         ` Jeffrey Carter
2014-06-17 11:14                           ` gvdschoot
2014-06-17 17:42                             ` Jeffrey Carter
2014-06-17 12:56                           ` Simon Clubley
2014-06-17 17:43                             ` Jeffrey Carter
2014-06-17 19:46                               ` Jacob Sparre Andersen
2014-06-26  1:20                                 ` Yannick Duchêne (Hibou57)
2014-06-17 19:41                             ` Randy Brukardt
2014-06-17 20:08                               ` Jeffrey Carter
2014-06-18  5:46                                 ` Georg Bauhaus
2014-06-18  8:02                                   ` Dmitry A. Kazakov
2014-06-18  9:34                                     ` G.B.
2014-06-18 12:30                                       ` Dmitry A. Kazakov
2014-06-18 14:43                                         ` G.B.
2014-06-18 16:39                                           ` Dmitry A. Kazakov
2014-06-20  8:27                                             ` Georg Bauhaus
2014-06-25 22:43                 ` Yannick Duchêne (Hibou57)
2014-06-12 23:56               ` Shark8
2014-06-10 20:22         ` Simon Clubley
2014-06-10 21:14           ` Simon Clubley
2014-06-10 22:09             ` Luke A. Guest
2014-06-10 22:09           ` Luke A. Guest
2014-06-11  0:05           ` Jeffrey Carter
2014-06-11  7:32             ` Simon Clubley
2014-06-11 16:50               ` G.B.
2014-06-11 19:20               ` Jeffrey Carter
2014-06-12  7:01                 ` Simon Clubley
2014-06-12 17:46                   ` Jeffrey Carter
2014-06-12 21:40                     ` Simon Clubley
2014-06-13  6:37                       ` J-P. Rosen
2014-06-13 12:03                         ` Simon Clubley
2014-06-13 15:34                           ` Lucretia
2014-06-13 17:00                             ` Simon Clubley
2014-06-13 22:21                           ` Brian Drummond
2014-06-14 20:41                             ` Simon Clubley
2014-06-15  6:26                               ` Tero Koskinen
2014-06-16  0:11                                 ` Simon Clubley
2014-06-15 18:10                               ` Luke A. Guest
2014-06-16  0:00                                 ` Simon Clubley
2014-06-25  6:42                   ` Yannick Duchêne (Hibou57)
2014-06-25  7:29                     ` Georg Bauhaus
2014-06-25 12:17                     ` Simon Clubley
2014-06-12 23:53         ` Shark8
2014-06-13  4:28           ` Simon Clubley
2014-06-13  8:17             ` gvdschoot
2014-06-13 13:16               ` Simon Wright
2014-06-13 14:13                 ` gvdschoot
2014-06-13 15:52                   ` Shark8
2014-06-13 17:04                   ` Simon Clubley
2014-06-13 20:10                     ` Simon Wright
2014-06-15  6:33                 ` Tero Koskinen
2014-06-15  7:47                   ` gvdschoot
2014-06-15  8:13                     ` gvdschoot
2014-06-15  8:18                     ` Nasser M. Abbasi
2014-06-16  0:16                       ` Simon Clubley
2014-06-16  0:35                     ` Simon Clubley
2014-06-16  6:08                       ` Georg Bauhaus
2014-06-16  6:19                         ` Georg Bauhaus
2014-06-16 12:08                           ` Peter Chapin
2014-06-25 22:28                             ` Yannick Duchêne (Hibou57)
2014-06-16 12:30                           ` Simon Clubley
2014-06-16  6:22                         ` gvdschoot
2014-06-25  6:28         ` Yannick Duchêne (Hibou57)
2014-06-11  8:27     ` Maciej Sobczak
2014-06-11 19:39       ` Peter Chapin
2014-06-11 19:52         ` Luke A. Guest
2014-06-12  1:39           ` Peter Chapin
2014-06-12  2:46             ` Dan'l Miller
2014-06-12 11:24               ` Peter Chapin
2014-06-12 11:36                 ` Lucretia
2014-06-12 14:48                 ` björn lundin
2014-06-12 22:12                   ` Simon Clubley
2014-06-13  8:36                     ` Dmitry A. Kazakov
2014-06-13 15:55                       ` Shark8
2014-06-13 16:13                         ` Dmitry A. Kazakov
2014-06-13 20:57                       ` Robert A Duff
2014-06-14  7:27                         ` Georg Bauhaus
2014-06-14 21:02                         ` Simon Clubley
2014-06-16 16:39                         ` Randy Brukardt
2014-06-16 17:13                           ` Dmitry A. Kazakov
2014-06-16 17:24                           ` Simon Clubley
2014-06-16 19:13                             ` Simon Wright
2014-06-16 20:25                               ` Simon Clubley
2014-06-17 16:10                                 ` Simon Wright
2014-06-16 21:53                           ` Robert A Duff
2014-06-16 23:02                             ` Jeffrey Carter
2014-06-16 23:42                               ` Robert A Duff
2014-06-17 19:18                                 ` Randy Brukardt
2014-06-14 21:05                       ` Maciej Sobczak
2014-06-15  6:52                         ` Dmitry A. Kazakov
2014-06-15 10:04                           ` Georg Bauhaus
2014-06-15 12:25                             ` Dmitry A. Kazakov
2014-06-17  8:18                           ` Maciej Sobczak
2014-06-17  9:13                             ` Dmitry A. Kazakov
2014-06-18  7:55                               ` Maciej Sobczak
2014-06-18  8:31                                 ` Dmitry A. Kazakov
2014-06-12  8:16         ` Georg Bauhaus
replies disabled

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