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-Thread: a07f3367d7,e276c1ed16429c03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Vinzent Hoefler" Newsgroups: comp.lang.ada Subject: Re: Ada is getting more popular! Date: Wed, 13 Oct 2010 22:17:45 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: individual.net I/qLLmuAGJEcXJRJkbECmwWXTLCS9tfdboc7+JIKQKZAjBcY/T Cancel-Lock: sha1:spmcy7IXtTSNiWFh/bIQjcYz1iQ= User-Agent: Opera Mail/10.62 (Win32) Xref: g2news2.google.com comp.lang.ada:15487 Date: 2010-10-13T22:17:45+02:00 List-Id: On Wed, 13 Oct 2010 14:07:13 +0200, ramon_garcia wrote: > - Vendor dependency: there are few vendors of Ada products. It is > neccessary in practice to use vendor extensions to write useful > software. Then you are most probably doing something wrong. > For instance, I must depend on array accesses in GNAT > containing both the addess and the bounds of the array. Why? > In addition, I > also depend on the implementation recomendation that array'adress > points to the first element. I don't get it. From what you describe it seems you are programming C-style. I've never used 'Address except for hardware-dependent and thus inherently unportable stuff. > - Complex language that requries plenty of typing. That's by design. Actually, I like it. It makes reading the source code so much easier. > At least I would expect to have an option "new package" that defines > a package spec and body. Huh? For these four lines? And if you really need that, write a small Python plug-in. ;) Something along the lines: -- 8< -- def Create_Package (Name): Spec_File = GPS.File (Name + ".ads") Spec_File.set_property ("language", "ada") Editor = GPS.EditorBuffer.get(Spec_File) Start = Editor.beginning_of_buffer() Editor.insert (Start, '\n'.join ([' '.join (["package", Name, "is"]), ' '.join (["end", Name]) + ";"])) Editor.save() Body_File = GPS.File (Name + ".adb") Body_File.set_property ("language", "ada") Editor = GPS.EditorBuffer.get(Body_File) Start = Editor.beginning_of_buffer() Editor.insert (Start, '\n'.join ([' '.join (["package", "body", Name, "is"]), ' '.join (["end", Name]) + ";"])) Editor.save() -- 8< -- > Or that declaring a > function in the spec creates an empty body (this is posible in Emacs, > but not in GPS, only creating all the body from all the spec with gnat- > stub rather than adding a function to the body from a new function to > the spec). Same here. I'm too lazy to write a script for that right now. > - Missing language features. Such a complex language must have design > issues. I find suprising that Object'Pool_Address extension from GNAT > is not standard. (It is a little inconsistent and bogus, by the way). > Some things are almost imposible or require difficult contorsions. For > instnace, I have not yet found a reasonable way to insert an array of > discriminated elements in a discriminated record. Something like > > type my_container(counter: integer, discriminated_attribute: integer) > is record > data: array(0..counter) of contained(discriminated_attribute); > end record; The to-be-inserted record type must have a default discriminant. type Disc_Array is array (Positive range <>) of Discriminated_Record; type My_Container (Counter : Positive) is record Data : Disc_Array (1 .. Counter); end record; That should do the trick. Of course, you need to have an initialization operation then and the array elements may have different discriminants. > This straightforward way is not posible because one cannot use an > anonymous array type inside a record (by the way, I find this feature > unjustified). Well, considering that you probably want to operate on the array in some way or another it must have a type. Otherwise you can't declare operations for it. So, not allowing anonymous array types has some value here. > But, even defining a type for the array does not work > because there is no way of passing the attribute from my_container to > the contained elements. Yes, because it has to be static. See above. > For instance, think about a data structure like > > m, n: integer > > m times: > flaga: boolean; > array of n bytes; > > The desiable way of representing this model is imposible. No. It's just not possible in the way you'd like to shove it up the compiler's butt. ;) > This is just an example of a particular issue that I find. The concept > is that a complex design has many rough edges. It has something to do with compilability. If the compiler can't figure out the size for the object, it can't create it. So there's no point in allowing arbitrary constructs. Vinzent. -- There is no signature.