comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: What makes a procedure call 'dispatching' in Ada?
Date: Fri, 20 Nov 2009 16:19:57 +0200
Date: 2009-11-20T16:19:57+02:00	[thread overview]
Message-ID: <4b06a5b3$0$3842$4f793bc4@news.tdc.fi> (raw)
In-Reply-To: <he67b2$h79$1@nntp.ilk.net>

Markus Schoepflin wrote:
> Markus Schoepflin wrote:
>> Dmitry A. Kazakov wrote:
>>
>> [...]
>>
>> Thanks for you swift and helpful reply.
>>
>>> If P is to be defined in terms of any type from the class FOO, then P 
>>> has
>>> to be declared differently (class-wide):
>>
>> So If I understand this correctly, if I want dispatching to happen on 
>> a given type, I always need to use the class type?
>>
> 
> And one more question, can I have a dispatching procedure that doesn't 
> explicitly use the type it dispatches on?

No, as there is no implicit "this" parameter in Ada (and no syntactic 
brackets to group all the operations of a type). To make an operation 
overridable (a "primitive operation" in Ada terms) you have to include 
one or more parameters of the type (or of "access" to the type) or it 
must return a value of the type (or "access" to the type). And moreover 
the operation must be declared in the same package declaration as the type.

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



  reply	other threads:[~2009-11-20 14:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 13:15 What makes a procedure call 'dispatching' in Ada? Markus Schoepflin
2009-11-20  9:31 ` stefan-lucks
2009-11-20 14:10   ` Niklas Holsti
2009-11-20 13:27 ` Dmitry A. Kazakov
2009-11-20 13:43   ` Markus Schoepflin
2009-11-20 13:54     ` RasikaSrinivasan@gmail.com
2009-11-20 13:58     ` Markus Schoepflin
2009-11-20 14:19       ` Niklas Holsti [this message]
2009-11-21 14:07       ` Peter C. Chapin
2009-11-20 14:00     ` Niklas Holsti
2009-11-20 14:10     ` Dmitry A. Kazakov
2009-11-20 13:56 ` Niklas Holsti
2009-11-20 14:31   ` Dmitry A. Kazakov
2009-11-20 15:00     ` Niklas Holsti
2009-11-20 18:44       ` Dmitry A. Kazakov
2009-11-20 20:09         ` Niklas Holsti
2009-11-20 20:59           ` Dmitry A. Kazakov
2009-11-20 14:54 ` Ludovic Brenta
replies disabled

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