comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Overriding puzzle
Date: Wed, 30 Dec 2015 17:13:21 -0600
Date: 2015-12-30T17:13:21-06:00	[thread overview]
Message-ID: <n61oei$86e$1@loke.gir.dk> (raw)
In-Reply-To: c63a98f4-1127-4e7d-852f-ad418a4a749f@googlegroups.com

<marciant@earthlink.net> wrote in message 
news:c63a98f4-1127-4e7d-852f-ad418a4a749f@googlegroups.com...
>I do not think that that is it. I think that type custom should be declared 
>in a package like A is.

In general, you'd be correct, but in the specific instance of a single 
overriding routine, you'll get the right answer in a procedure. But you 
can't add any new primitive operations in a subprogram, and you can't 
override anything after the first body (and most people will only write 
bodies in a subprogram declarative part). Ergo, it works fine for silly 
examples like this one, but it's a bad habit to get into.

                                 Randy.



      parent reply	other threads:[~2015-12-30 23:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30 14:49 Overriding puzzle gautier_niouzes
2015-12-30 15:10 ` Egil H H
2015-12-30 17:31   ` gautier_niouzes
2015-12-30 18:07   ` marciant
2015-12-30 18:24     ` gautier_niouzes
2015-12-30 21:40       ` marciant
2015-12-30 23:10         ` Randy Brukardt
2015-12-31  8:22           ` Niklas Holsti
2015-12-31  8:42             ` Dmitry A. Kazakov
2016-01-03  7:18             ` Randy Brukardt
2015-12-31 16:30           ` marciant
2015-12-30 23:13     ` Randy Brukardt [this message]
replies disabled

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