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: fac41,b2bad1e85ca20475 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,5b3c19b1631bb558 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-10-31 19:27:05 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!135.173.83.19!wnmasters2!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <39FF8DE3.EC0055B5@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.eiffel,comp.lang.ada Subject: Re: The best thing/greatest feature summary References: <39DCB9E3.EAE8F426@ftw.rsc.raytheon.com> <39F9FCCE.D6719C6F@ftw.rsc.raytheon.com> <1c9kvs4uvj4ofd46f7a8vq0pju596iu2gr@4ax.com> <39fed7b6@rsl2.rslnet.net> <39FF1DBD.74184FDC@worldnet.att.net> <39ff792d@rsl2.rslnet.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 01 Nov 2000 03:27:04 GMT NNTP-Posting-Host: 12.74.130.215 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 973049224 12.74.130.215 (Wed, 01 Nov 2000 03:27:04 GMT) NNTP-Posting-Date: Wed, 01 Nov 2000 03:27:04 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.eiffel:946 comp.lang.ada:1679 Date: 2000-11-01T03:27:04+00:00 List-Id: What is the cost here? It really depends upon how much of java.lang.reflect you really want to emulate. For instance, most of the classes in java.lang.reflect rely on an ability to suppress access checks. They fundamentally violate the access restrictions designed into classes and class members. Do you want to emulate supression of access checks, so that Ada data and subprograms defined in the private part of a package specification, or in the body of a package, will be have public visibility? In other words, do you want to be able to destroy encapsulation? If you only want to emulate the Member interface in java.lang.reflect you can instantiate the following generic package in the bodies of your packages. ----------------------------------------------------------------------- -- Generic package to define a "common" interface for providing -- debug information. ----------------------------------------------------------------------- generic Package_Name : String; package Reflect is function Get_Package return String; function Get_Name return String; procedure Set_Name(Id : in String); end Reflect; ----------------------------------------------------------------------- -- Generic package body to define a "common" interface for providing -- debug information. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; package body Reflect is Proc_Name : Ada.Strings.Unbounded.Unbounded_String; -------------- -- Get_Name -- -------------- function Get_Name return String is begin return Ada.Strings.Unbounded.To_String(Proc_Name); end Get_Name; ----------------- -- Get_Package -- ----------------- function Get_Package return String is begin return Package_Name; end Get_Package; -------------- -- Set_Name -- -------------- procedure Set_Name (Id : in String) is begin Proc_Name := Ada.Strings.Unbounded.To_Unbounded_String(Id); end Set_Name; end Reflect; ------------ I see no reason to make this package part of the language standard simply because Java defines an interface with similar capabilities. However, you may find such a package highly necessary. That is why I have posted it here. Use it if you wish. Jim Rogers Colorado Springs, Colorado Tom Hargraves wrote: > > Good point James. > All these ease-of-programming features come at a cost. > > But what is the cost here? A few strings can hardly be much of a cost > nowadays. I'm not asking for a 1Mbyte dynamic .GIF icon to popup, just a > routine name... > > These 256 byte strings could live quite happily in the corner of the xMbyte > proms and nobody would even know they where there ;-) > > (OK, so I'm setting myself up here. There's bound to be a space shuttle > designer out there who knows the weight of a byte of memory and how much it > costs to put it in orbit...) > > Regards, > Tom H.