From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f9c7f7f00103ac6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-10 05:49:12 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!news.iag.net!news.mathworks.com!uunet!world!bobduff From: bobduff@world.std.com (Robert A Duff) Subject: Re: Constructor in ADA9X Message-ID: Organization: The World Public Access UNIX, Brookline, MA References: <3h61fh$92n@rc1.vub.ac.be> <3h6bno$7q8@toads.pgh.pa.us> Date: Fri, 10 Feb 1995 13:49:12 GMT Date: 1995-02-10T13:49:12+00:00 List-Id: In article , Ray Toal wrote: > type Rectangle is new Shape with private; > function Make_Rectangle (R: in out Rectangle; Width, Height: Real) > return Rectangle; I don't understand why Make_Rectangle takes a Rectangle as a parameter, and also returns one as a result. Don't you mean something like this instead: function Make_Rectangle (Width, Height: Real) return Rectangle; If that's what you meant, then you could make it class-wide: function Make_Rectangle (Width, Height: Real) return Rectangle'Class; This function will not be inherited. Alternatively, you can call all your constructors the same name (say, "Make") -- then it won't do any harm that they get inherited. - Bob