* Ada extension information @ 2009-05-28 18:26 info 2009-05-28 18:30 ` Martin ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: info @ 2009-05-28 18:26 UTC (permalink / raw) Hello, a-textio.adb released with GNAT 2009 GPL for windows, contains: Item := (if not Is_Start_Of_Encoding (Character'Val (ch), File.WC_Method) then Character'Val (ch) else Get_Upper_Half_Char_Immed (Character'Val (ch), File)); which is easy enough to understand but is not standard Ada. GNAT 2009 tells me : try.adb:5:09: conditional expression is an Ada extension try.adb:5:09: use -gnatX switch to compile this unit http://www.adacore.com/2009/03/29/NF-63-I317-009-gnat/ discusses this. Is it not jumping the gun a little to use these extensions to document standard libraries before they become official, or even documented? More specifically where are these Ada extensions formally documented? (Ada Conformity Assessment Authority seem to have discussion about this up to 15th March 2009 !) PS In the meantime Mika is broken if you use a-textio as distributed with GNAT GPL 2009. Sincerely, http://www.midoan.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ada extension information 2009-05-28 18:26 Ada extension information info @ 2009-05-28 18:30 ` Martin 2009-05-30 0:25 ` Randy Brukardt 2009-05-28 21:22 ` Georg Bauhaus 2009-05-30 7:13 ` anon 2 siblings, 1 reply; 8+ messages in thread From: Martin @ 2009-05-28 18:30 UTC (permalink / raw) On May 28, 7:26 pm, i...@midoan.com wrote: > Hello, > a-textio.adb released with GNAT 2009 GPL for windows, contains: > > Item := > (if not Is_Start_Of_Encoding (Character'Val (ch), > File.WC_Method) > then Character'Val (ch) > else Get_Upper_Half_Char_Immed (Character'Val (ch), > File)); > > which is easy enough to understand but is not standard Ada. > > GNAT 2009 tells me : > > try.adb:5:09: conditional expression is an Ada extension > try.adb:5:09: use -gnatX switch to compile this unit > > http://www.adacore.com/2009/03/29/NF-63-I317-009-gnat/discusses > this. > > Is it not jumping the gun a little to use these extensions to document > standard libraries before they become official, or even documented? Probably not, as there is nothing I know of requires the standard libraries to be written in Ada, let alone 'vanilla' Ada. Even if it was in the public part of the specification I guess it would still be ok if used for something 'implementation-defined'. Cheers -- Martin ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ada extension information 2009-05-28 18:30 ` Martin @ 2009-05-30 0:25 ` Randy Brukardt 0 siblings, 0 replies; 8+ messages in thread From: Randy Brukardt @ 2009-05-30 0:25 UTC (permalink / raw) "Martin" <martin.dowie@btopenworld.com> wrote in message news:0d9fe71d-788c-46b0-8c5b-18bd229d7246@r3g2000vbp.googlegroups.com... ... >> Is it not jumping the gun a little to use these extensions to document >> standard libraries before they become official, or even documented? > >Probably not, as there is nothing I know of requires the standard >libraries to be written in Ada, let alone 'vanilla' Ada. > >Even if it was in the public part of the specification I guess it >would still be ok if used for something 'implementation-defined'. That is correct. There is no requirement that Ada standard packages be implemented in Ada (although generally the standard tries to make that possible). I think it is unusual if all of the standard packages *are* implemented in Ada. For instance, Janus/Ada has a couple of units implemented in assembler, and there are also a number of standard packages that are 'built-in'; that is there is no implementation at all (the compiler just generates the needed code). Obviously, portability is enhanced if units don't depend on compiler-specific features, but that hardly matters for the language-defined units. No one is going to try to compile the Janus/Ada Ada.Text_IO package with GNAT (or vice versa) -- both compilers have their own! Randy. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ada extension information 2009-05-28 18:26 Ada extension information info 2009-05-28 18:30 ` Martin @ 2009-05-28 21:22 ` Georg Bauhaus 2009-05-28 21:31 ` Georg Bauhaus 2009-05-28 22:06 ` Adam Beneschan 2009-05-30 7:13 ` anon 2 siblings, 2 replies; 8+ messages in thread From: Georg Bauhaus @ 2009-05-28 21:22 UTC (permalink / raw) info@midoan.com wrote: > More specifically where are these Ada extensions formally documented? This is AI 147, Conditional Expressions (as primaries). http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0147-1.txt?rev=1.2 Yet another thing that makes Ada more attractive for programmers who would not waste valuable time for finding names, say write a small named function that conditionally returs this or that. Obviously, local functions are overly verbose and explicative, they must be avoided at all cost. Ada finally gets C's ?: conditionals! Have you ever seen anyone using ?: in C or Perl in a way that is obfuscating? Really? Nah, it's nice! We can even leave out the bulky comb structure. Just pairs of parentheses! the Lisp fans will rejoyce, C programmers will feel at home, done with a single stroke! loop exit if (if N > 0 then M/N > 0 else M > 1); N := F(M, N); end loop; Not even Lisp or ML style let bindings are necessary! Ah, fancy that! We've got more and more anonymous pointers, free and easy, why not free floating control structure then? I forget, it's a nice opportunity for tool vendors to sell more style enforcment programs and language restriction options. They are learning ... :-) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ada extension information 2009-05-28 21:22 ` Georg Bauhaus @ 2009-05-28 21:31 ` Georg Bauhaus 2009-05-28 22:06 ` Adam Beneschan 1 sibling, 0 replies; 8+ messages in thread From: Georg Bauhaus @ 2009-05-28 21:31 UTC (permalink / raw) Georg Bauhaus wrote: The first signs of confusion have already made it into this example ;-) > loop > exit if (if N > 0 then M/N > 0 else M > 1); exit when (if N > 0 then M/N > 0 else M > 1); > N := F(M, N); > end loop; ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ada extension information 2009-05-28 21:22 ` Georg Bauhaus 2009-05-28 21:31 ` Georg Bauhaus @ 2009-05-28 22:06 ` Adam Beneschan 1 sibling, 0 replies; 8+ messages in thread From: Adam Beneschan @ 2009-05-28 22:06 UTC (permalink / raw) On May 28, 2:22 pm, Georg Bauhaus <rm.tsoh.plus- bug.bauh...@maps.futureapps.de> wrote: > i...@midoan.com wrote: > > More specifically where are these Ada extensions formally documented? > > This is AI 147, Conditional Expressions (as primaries).http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0147-1.txt?rev=1.2 > > Yet another thing that makes Ada more attractive > for programmers who would not waste valuable time > for finding names, say write a small named function > that conditionally returs this or that. > Obviously, local functions are overly verbose > and explicative, they must be avoided at all cost. > > Ada finally gets C's ?: conditionals! > Have you ever seen anyone using ?: in C or Perl in > a way that is obfuscating? Really? > > Nah, it's nice! We can even leave out the bulky > comb structure. Just pairs of parentheses! > the Lisp fans will rejoyce, C programmers will > feel at home, done with a single stroke! > > loop > exit if (if N > 0 then M/N > 0 else M > 1); > N := F(M, N); > end loop; > > Not even Lisp or ML style let bindings are necessary! > Ah, fancy that! We've got more and more anonymous pointers, > free and easy, why not free floating control structure > then? I forget, it's a nice opportunity for tool vendors > to sell more style enforcment programs and language restriction > options. They are learning ... :-) Hey, it's not part of the Ada language yet, so no need to get all worked up. This feature could still be rejected. And yes, this is certainly a feature that could be abused. But as the AI makes clear, there are cases where it can improve readability because there's no other good way to accomplish the same thing. Sure, there are programmers who don't understand readability who would use this construct in an inappropriate place, just because the feature is there. But those programmers probably wouldn't write readable code no matter how many features you took away from them. I've seen plenty of incomprehensible Ada 83 code so I'm sure this is true. -- Adam ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ada extension information 2009-05-28 18:26 Ada extension information info 2009-05-28 18:30 ` Martin 2009-05-28 21:22 ` Georg Bauhaus @ 2009-05-30 7:13 ` anon 2009-05-30 10:13 ` info 2 siblings, 1 reply; 8+ messages in thread From: anon @ 2009-05-30 7:13 UTC (permalink / raw) The problem is, those extra routines that make use of the "C like conditional compiling statements" are define in the body and referenced in the private sections of "Ada.Text_IO" and "Ada.Wide_Text_IO" packages. The comments state that they are for a sub-package "Ada.Text_IO.Wide_Text_IO" that is not present in the source. In scanning all 2850 plus files in the 2009 GNAT, the only references to this sub-package is in comments from the following 3 files: Ada.Text_IO Ada.Wide_Text_IO and System.WCh_WtS So, why are these routines in the two Text IO packages, and where is that child package "Ada.Text_IO.Wide_Text_IO"? Now, if these routines are defined and reference only with-in the package they are defined, then why are these routines references in the specification private area, they should be at the top of the body, hidden from the specification side. Keeping the Ada Text packages more precise to the Ada language, instead of junking it up with references that are not used outside ofthat package. Or is this somewhat of an advance copy of 2010/2011 version of Ada.Text_IO and a new "Ada.Text_IO.Wide_Text_IO" package. And there is no reference in the documentation of the "C like conditional compiling statements". From RM 1.1.3 "Conformity of an Implementation with the Standard" 6 Contain no variations except those explicitly permitted by this International Standard, or those that are impossible or impractical to avoid given the implementation's execution environment; 7 Specify all such variations in the manner prescribed by this International Standard. No True Ada programmer wants "Language extensions" without references. And most would prefer some simple references that is stated with-in the RM, not just hinted to by the RM, like having a RM section on what type "conditional compiling statements" would be acceptable with a few examples. So where is the documentation that is requred by RM 1.1.3 ( 7 ). Plus, I have not found where "conditional compiling statements" are allow in Ada RM 1.1.3 ( 6 ). And in some cases "conditional compiling statements" kills the need for generic package. Plus, there is another Adacore pragma ( sample located in body of Ada.Sequential_IO ). This seams to bypass the requirement to use "-gnatX". pragma Extensions_Allowed ( On | Off ) ; with no documentation in the GNAT Documentation User's Guide ( GNAT_UGN ) or the GNAT Reference Manual ( GNAT_RM ). Plus, if Adacore want to extend Ada, they normally use a child package with-in the GNAT package structure to test the idea before forcing the changes into the the Ada package structure. And finally what other changes have been made and how to disable them. Aka to turn off all "conditional expressions"? And for that reason the "C like conditional compiling statements" should never be in the core Ada or core System packages that are define in the RM. In <d784432e-fa9d-4bc9-b849-ecb2208afc73@c9g2000yqm.googlegroups.com>, info@midoan.com writes: >Hello, >a-textio.adb released with GNAT 2009 GPL for windows, contains: > >Item := > (if not Is_Start_Of_Encoding (Character'Val (ch), >File.WC_Method) > then Character'Val (ch) > else Get_Upper_Half_Char_Immed (Character'Val (ch), >File)); > >which is easy enough to understand but is not standard Ada. > >GNAT 2009 tells me : > >try.adb:5:09: conditional expression is an Ada extension >try.adb:5:09: use -gnatX switch to compile this unit > >http://www.adacore.com/2009/03/29/NF-63-I317-009-gnat/ discusses >this. > >Is it not jumping the gun a little to use these extensions to document >standard libraries before they become official, or even documented? > >More specifically where are these Ada extensions formally documented? >(Ada Conformity Assessment Authority seem to have discussion about >this up to 15th March 2009 !) > >PS In the meantime Mika is broken if you use a-textio as distributed >with GNAT GPL 2009. > >Sincerely, >http://www.midoan.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ada extension information 2009-05-30 7:13 ` anon @ 2009-05-30 10:13 ` info 0 siblings, 0 replies; 8+ messages in thread From: info @ 2009-05-30 10:13 UTC (permalink / raw) On May 30, 8:13 am, a...@anon.org (anon) wrote: > The problem is, those extra routines that make use of the "C like conditional > compiling statements" are define in the body and referenced in the private > sections of "Ada.Text_IO" and "Ada.Wide_Text_IO" packages. The comments > state that they are for a sub-package "Ada.Text_IO.Wide_Text_IO" that is not > present in the source. In scanning all 2850 plus files in the 2009 GNAT, the > only references to this sub-package is in comments from the following 3 files: > > Ada.Text_IO > Ada.Wide_Text_IO > and > System.WCh_WtS > > So, why are these routines in the two Text IO packages, and where is that > child package "Ada.Text_IO.Wide_Text_IO"? > > Now, if these routines are defined and reference only with-in the package > they are defined, then why are these routines references in the specification > private area, they should be at the top of the body, hidden from the > specification side. Keeping the Ada Text packages more precise to the Ada > language, instead of junking it up with references that are not used outside > ofthat package. > > Or is this somewhat of an advance copy of 2010/2011 version of > Ada.Text_IO and a new "Ada.Text_IO.Wide_Text_IO" package. > > And there is no reference in the documentation of the "C like conditional > compiling statements". > > From RM 1.1.3 "Conformity of an Implementation with the Standard" > > 6 Contain no variations except those explicitly permitted by this > International Standard, or those that are impossible or > impractical to avoid given the implementation's execution > environment; > > 7 Specify all such variations in the manner prescribed by this > International Standard. > > No True Ada programmer wants "Language extensions" without references. > And most would prefer some simple references that is stated with-in the RM, > not just hinted to by the RM, like having a RM section on what type > "conditional compiling statements" would be acceptable with a few examples. > > So where is the documentation that is requred by RM 1.1.3 ( 7 ). Plus, > I have not found where "conditional compiling statements" are allow > in Ada RM 1.1.3 ( 6 ). And in some cases "conditional compiling > statements" kills the need for generic package. > > Plus, there is another Adacore pragma ( sample located in body of > Ada.Sequential_IO ). This seams to bypass the requirement to use > "-gnatX". > > pragma Extensions_Allowed ( On | Off ) ; > > with no documentation in the GNAT Documentation User's Guide ( GNAT_UGN ) > or the GNAT Reference Manual ( GNAT_RM ). > > Plus, if Adacore want to extend Ada, they normally use a child package > with-in the GNAT package structure to test the idea before forcing the > changes into the the Ada package structure. > > And finally what other changes have been made and how to disable them. Aka > to turn off all "conditional expressions"? And for that reason the "C like > conditional compiling statements" should never be in the core Ada or core > System packages that are define in the RM. > > In <d784432e-fa9d-4bc9-b849-ecb2208af...@c9g2000yqm.googlegroups.com>, i...@midoan.com writes: > >Hello, > >a-textio.adb released with GNAT 2009 GPL for windows, contains: > > >Item := > > (if not Is_Start_Of_Encoding (Character'Val (ch), > >File.WC_Method) > > then Character'Val (ch) > > else Get_Upper_Half_Char_Immed (Character'Val (ch), > >File)); > > >which is easy enough to understand but is not standard Ada. > > >GNAT 2009 tells me : > > >try.adb:5:09: conditional expression is an Ada extension > >try.adb:5:09: use -gnatX switch to compile this unit > > >http://www.adacore.com/2009/03/29/NF-63-I317-009-gnat/discusses > >this. > > >Is it not jumping the gun a little to use these extensions to document > >standard libraries before they become official, or even documented? > > >More specifically where are these Ada extensions formally documented? > >(Ada Conformity Assessment Authority seem to have discussion about > >this up to 15th March 2009 !) > > >PS In the meantime Mika is broken if you use a-textio as distributed > >with GNAT GPL 2009. > > >Sincerely, > >http://www.midoan.com > > Just to clarify what Mika, our test data generator, uniquely it appears, does. During test data generation, and only if the user's code uses standrad libraries, Mika analyses the standard libraries and uses that information to simulate their behaviour. We believe that this approach is more accurate, repeatable and thorough than other alternatives such as writing manual stubs for them. It also offers the possibility of generating more interesting tests that cover the CFG of the standard libraries (not to test the standard libraries, but rather to generate tests that are borderline and that may not be expected by the developers). It therefore makes our job easier if the libraries are written in standard Ada. The fact that they are close to it is already a great help for us: althought we cannot analyse everything, things left in code during development (but would probably be removed in the final version) such as usages of textio do not have to removed; the code does not have to be modified. We released a minor update yesterday, and Mika can now parse conditional expressions in standard libraries. Regards, Midoan ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-05-30 10:13 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-05-28 18:26 Ada extension information info 2009-05-28 18:30 ` Martin 2009-05-30 0:25 ` Randy Brukardt 2009-05-28 21:22 ` Georg Bauhaus 2009-05-28 21:31 ` Georg Bauhaus 2009-05-28 22:06 ` Adam Beneschan 2009-05-30 7:13 ` anon 2009-05-30 10:13 ` info
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox