comp.lang.ada
 help / color / mirror / Atom feed
From: Egil H H <ehh.public@gmail.com>
Subject: Re: "end of declaration"
Date: Wed, 10 Feb 2021 11:21:00 -0800 (PST)	[thread overview]
Message-ID: <07236c74-1838-42bd-9d02-bde8cb308071n@googlegroups.com> (raw)
In-Reply-To: <82631dc2-2903-4848-b662-eb149331623cn@googlegroups.com>

On Wednesday, February 10, 2021 at 7:40:00 PM UTC+1, 0012...@gmail.com wrote:
> 
> I define a type in the private part of the package, and in the body I clone it (type t_proba2 is new t_proba) to benefit from its predefined operations... 
What? The predefined operations are already visible in the body.

> since it's a fixed point type I need to, or bam ! recursion...
huh? 

> package body P_Proba2 is 
> type t_proba2 is new T_Proba2; 
> -- type t_proba2 can't be use before the end of its declaration 
This is because of a typo... Try
    type t_proba2 is new T_Proba; 
instead. Except that you don't need this derived type, so just delete the line.

> package Point_Fixe_io is new Ada.Text_Io.Fixed_IO(T_Proba); 
...and here you're using the original type anyway, so...

> no nicer way to access predefined operations for these cases ?
Just call them, they are visible...

-- 
~egilhh

  parent reply	other threads:[~2021-02-10 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 18:39 "end of declaration" Mehdi Saada
2021-02-10 19:06 ` AdaMagica
2021-02-10 19:21 ` Egil H H [this message]
2021-02-10 19:31   ` Mehdi Saada
2021-02-10 21:08     ` Shark8
2021-02-10 22:43       ` Niklas Holsti
2021-02-10 20:59 ` Shark8
replies disabled

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