comp.lang.ada
 help / color / mirror / Atom feed
From: gauthier@alphainfo.unilim.fr (Michel Gauthier)
Subject: Ada 0y wish list: parameters of package parameters
Date: 15 Feb 2001 13:07:00 GMT
Date: 2001-02-15T13:07:00+00:00	[thread overview]
Message-ID: <gauthier-1502011408080001@193.50.185.13> (raw)


My main wish about Ada-0Y is about the following.

I am used to defining what I call 'signature packages', generic 
packages with in principle nothing inside, but suitable to 
define future parameters.

    generic
        type Item_Type is private ;
        -- operations defining something like an algebraic structure
    package Some_Algebra is end ;

Example of use :

    generic
        with package Numbers is new Ring_Structure ( <> ) ;
    package Polynomials is
        ...
    end Polynomials ;

No problem at this point.

The problem appears when I add signatures for order structures, 
and try to specify. The intent is :

    generic
        with package Structure_1 is new Algrbraic_Structure ( any parameters ) ;
        with package Structure_2 is new Order_Structure ( same type ,
anything else ) ;
    package Something is
        ...
    end Something ;

Ada-95 solutions are complex and not fully general.
A possible syntax could be :

        with package Structure_1 is new Algrbraic_Structure ( <> ) ;
        with package Structure_2 is new Order_Structure
                    ( Structure_1 . Item_Type , others => <> ) ;

Any suggestion or opinion ?

----------          ----------          ----------          ---------- 
Michel Gauthier / Laboratoire d'informatique
83, rue d'Isle / F-87000 Limoges
telephone +33 555 43 69 73
fax +33 555 43 69 77
----------          ----------          ----------          ----------
Nous n'etions pas dans la langueur,
nous ne sombrons pas dans l'allegresse.
----------          ----------          ----------          ----------



             reply	other threads:[~2001-02-15 13:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-15 13:07 Michel Gauthier [this message]
2001-02-17  8:24 ` Ada 0y wish list: parameters of package parameters Dr Adrian Wrigley
2001-02-20 18:28   ` Stephen Leake
2001-02-20 18:37 ` Ehud Lamm
replies disabled

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