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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c39ad3e35a7690a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.222.71 with SMTP id qk7mr10377780pbc.1.1329156644178; Mon, 13 Feb 2012 10:10:44 -0800 (PST) Path: wr5ni20930pbc.0!nntp.google.com!news2.google.com!goblin3!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Convention for naming of packages Date: Mon, 13 Feb 2012 19:10:41 +0100 Organization: Ada @ Home Message-ID: References: <4f355230$0$21451$ba4acef3@reader.news.orange.fr> <1sx3fy79wys5s.1723nejowbg76.dlg@40tude.net> <15fgcngmgl41e$.113i7gtuwpwpv$.dlg@40tude.net> <12sbwz7m0r1qx.1pbp0ox3jr36s.dlg@40tude.net> NNTP-Posting-Host: TqfFTdzi95I8zBbbKWTz3Q.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.61 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-02-13T19:10:41+01:00 List-Id: Le Mon, 13 Feb 2012 18:19:16 +0100, Dmitry A. Kazakov = a =C3=A9crit: > It is a quite uncommon use anyway. I mean to have a package of instanc= es = > of > some types. > > But certainly if that happens the instance always have meaningful name= s > rather than "Object". E.g. > > package Units.Base is > Current : constant Unit; > Luminescence : constant Unit; > Temperature : constant Unit; > ... This is a good example, but still not a singleton, that's a specificatio= n, = there is no need for an instantion here. About package holding singleton really holding singleton, like say a Log= = package which would create a singleton file "Log.File" objct, I believe = = that's not good for re=E2=80=91usability (ex. what about multiple task?)= . Better = provide a type with a constructor, and if a file is to be shared between= = multiple "Log.Instance_Type" instance, then its up to the implementation= = to create allocate one and create association between the shared object = = and object created by users. That's all small=E2=80=91talks :-P > I think that any thing worth a name can be named. If not, that is beca= use > some language deficiency. I believe a language deficiency, if it really exist, always provide the = = filling of that deficiency first. I don't feel one here, even if I agree= I = may think the thing a different way with another language. A single thin= g = is not a deficiency alone, it is a deficiency with respect to a whole. T= he = whole seems rather Okay to me so far. What lacks for me here, is some paper with in deep talks about naming = convention in numerous ways. Most paper just talks about naming conventi= on = just as a quick overview. I see the deficiency here, not in the language= = (deficiency of culture of the language, not deficiency of the language).= >> The semantic may be thin, if the semantic is thin, then its = >> specification >> cannot be said too much thin for the sole reason it's thin. >> >> Element_Type would be Element + Type, as you say, and also what appea= rs = >> as >> the second parameter of an Add method. Its presence as the second >> parameter of Add defines what Element_Type is (not just its name = >> =E2=80=9CElement=E2=80=9D >> and its Type status in the Ada source text). > > It is a language deficiency here, namely the generics. If the type of = the > class (of the container type) could be properly typed, you would not n= eed > to have meaningless names in meaningless packages the only purpose of = = > which is meaningless instantiation. I don't what kind of language construct you imagine, but I am pretty sur= e = these construct would requires dedicated keywords somewhere, some keywor= ds = which would be the exact same as the names I am looking for. Ada's reserved word "type", is not meaningless, it's an high level conce= pt = (so is obviously abstract). Or else I did not understand your words? > But even with generics, it is another deficiency that the element type= = > (or > the class of) cannot be asked from the container type it belongs to, a= s > well as the type of the index and the type of sets of indices. Seems you are wishing Introspection in Ada. Funny for someone who dislik= e = languages which provides it ;-) Will fall to the same comment as above anyway. Type would just play some= = of the roles of packages (not all roles, some roles), and you would need= = some way to refer to things. Here, you will be back to the need of some = = name to refer to it. If a container type, named Container_Type can provide itself the type fo= r = its index. How can you refer to it, if not via some expression, like = "Container_Type.Index_Type"? Or else have you something different in mind? Could you write=E2=80=91do= wn a tiny = example using pseudo=E2=80=91code to make it clearer? -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity