comp.lang.ada
 help / color / mirror / Atom feed
From: Mehdi Saada <00120260a@gmail.com>
Subject: Re: making a son benefit access ton an instanciation of a generic package required as a formal parameter to his father and instanciated by him
Date: Sun, 21 Jan 2018 13:29:24 -0800 (PST)
Date: 2018-01-21T13:29:24-08:00	[thread overview]
Message-ID: <6378807a-d938-4fac-938b-d3a8616d7f25@googlegroups.com> (raw)
In-Reply-To: <p42tst$17l0$1@gioia.aioe.org>

> But you can use an exception from a generic instance 
still. 
I thought so too ! Maybe I should, but I can't:
the exception handler "when P1.Zero_Denominateur => sth;"
raises:
P2_G.Child.adb:66:25: exception "Zero_Denominator" is declared in generic formal package
P2_G.Child.adb:66:25: and therefore cannot appear in handler (RM 11.2(8))

BUT: the said exception is NOT defined here, but in P1_G ->
generic
   with package P1 is new P1_G(<>); -- IN THERE
package P2_G is

>The rule is too keep it as simple as possible. If there is any way to ditch generics, do it. Use interfaces and tagged types, mix-ins, class-wide access discriminants etc to achieve polymorphism.

Eurg... From the little bit I read (and could understand), you're not very popular about this here... I'll rather follow the majority, besides, I do like the idea of generics. And one can ALWAYS find loopholes and flex a language beyond sense. Do you expect lawyers to be gods ?

  reply	other threads:[~2018-01-21 21:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21 15:43 making a son benefit access ton an instanciation of a generic package required as a formal parameter to his father and instanciated by him Mehdi Saada
2018-01-21 15:58 ` Simon Wright
2018-01-21 17:30   ` Mehdi Saada
2018-01-21 17:39     ` Simon Wright
2018-01-21 17:50     ` Dmitry A. Kazakov
2018-01-21 20:15       ` Mehdi Saada
2018-01-21 20:41         ` Dmitry A. Kazakov
2018-01-21 21:29           ` Mehdi Saada [this message]
2018-01-21 21:31             ` Mehdi Saada
2018-01-21 22:20               ` Jeffrey R. Carter
2018-01-21 23:07                 ` Mehdi Saada
2018-01-21 23:10                   ` Mehdi Saada
2018-01-22  8:28                   ` Dmitry A. Kazakov
2018-01-22  9:25                     ` Simon Wright
2018-01-23  1:23           ` Randy Brukardt
2018-01-21 22:04         ` J-P. Rosen
2018-01-22 15:36           ` Mehdi Saada
2018-01-22 15:54             ` Mehdi Saada
2018-01-22 15:52           ` Simon Wright
2018-01-23  1:33             ` Randy Brukardt
2018-01-23 14:05   ` Mehdi Saada
2018-01-23  1:13 ` 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