comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: GDNative thick binding design
Date: Sat, 17 Oct 2020 03:09:04 -0700 (PDT)	[thread overview]
Message-ID: <9eff89cf-5345-4336-96a7-f75258697817n@googlegroups.com> (raw)
In-Reply-To: <dda8138e-3f2e-40e5-b917-472a03879079n@googlegroups.com>

> package GDNative.Thick.Objects is 
> type Object is abstract tagged private; 
> 
> -- create abstract or null subprograms for each subprogram here: 
> -- https://docs.godotengine.org/en/stable/classes/class_object.html#class-object 
> function Name (Self : in Object'class) return Wide_String is abstract; 
> procedure Initialize (Self : in out Object'class) is null; 
> -- etc... 
> 
> private 
> type Object is abstract tagged null record; 
> end; 
I do not know what you are trying to do, but I see a basic misunderstanding here wrt keyword abstract on operations.
It has two fundamentally different purposes:
* When used on a primitive operation of a nontagged type, it makes an inherited operation disappear, i.e. this operation does no longer exist, e.g.:
type T is range -42..42;
function "/" (L, R: T'Base) return T'Base is abstract;
* When used on a primitive operation of a tagged type, this operation is dispatching and must be overridden for derived types; e.g.
type T is abstrat tagged private;
procedure Op(X:T) is abstract;
type T1 is new T with private;
procedure Op(X:T1);
Now your
function Name (Self : in Object'class) return Wide_String is abstract;
is a classwide operation, not a primitive operation, so it canot be overridden. It is not a primitive operation of any type, so it just declares that such an operation cannot exist - a rather useless declaration.

  parent reply	other threads:[~2020-10-17 10:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 21:08 GDNative thick binding design Michael Hardeman
2020-10-16  6:38 ` Luke A. Guest
2020-10-16 16:39   ` Michael Hardeman
2020-10-16 18:09     ` Luke A. Guest
2020-10-16 18:28       ` Michael Hardeman
2020-10-16 18:31         ` Luke A. Guest
2020-10-21  2:58           ` Michael Hardeman
2020-10-21  6:59             ` Luke A. Guest
2020-10-21 22:08               ` Michael Hardeman
2020-10-21 23:22                 ` Luke A. Guest
2020-10-26  3:38                   ` Michael Hardeman
2020-10-26  5:41                     ` Per Sandberg
2020-10-26 13:53                       ` Michael Hardeman
2020-10-27  3:34                         ` Michael Hardeman
2020-10-17 10:09         ` AdaMagica [this message]
2020-10-18 20:21 ` Per Sandberg
2020-10-21  3:34   ` Michael Hardeman
2020-10-21 16:16     ` Per Sandberg
2020-10-21 22:48       ` Michael Hardeman
replies disabled

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