!standard 3.6.3(4/2) 17-10-05 AC95-00297/00 !class Amendment 17-10-05 !status received no action 17-10-05 !status received 17-09-11 !subject Counted strings !summary !appendix !topic counted strings !reference Ada 2012 RMss.ss(pp) !from Tarjei T. Jensen 17-09-11 !keywords counted strings !discussion It is time to get counted strings into the standard. The main reason is that they simplify string handling, makes the language less clunky and gives new users a gentle introduction to the language. The key to counted strings is that they need to be first class objects. The compiler must know how to handle them. Just like it would do when it handles integers or reals of different sizes. You don't have to overload := in order to assign a byte sized integer to a word sized integer. And you don't need to overload operators to add or subtract them. I strongly believe that implementing it as a general Ada feature will be ineffective. I know that it will be tempting to do so, but RESIST!!!!!! I also believe that educators will welcome such a move. Especially those who remember Turbo Pascal. *************************************************************** From: Randy Brukardt Sent: Monday, October 2, 2017 2:14 PM >It is time to get counted strings into the standard. The main reason is that >they simplify string handling, makes the language less clunky and gives new >users a gentle introduction to the language. (1) What is a counted string??? I've never heard of that term before. (2) What problem is being solved?? As noted everywhere, we're looking for problems that are hard to solve in current Ada; we're NOT looking for solutions to problems (we have no trouble inventing those, and it is important that the language stay consistent). >The key to counted strings is that they need to be first class objects. >The compiler must know how to handle them. Just like it would do when >it handles integers or reals of different sizes. You don't have to overload >:= in order to assign a byte sized integer to a word sized integer. And you >don't need to overload operators to add or subtract them. > >I strongly believe that implementing it as a general Ada feature will >be ineffective. I know that it will be tempting to do so, but RESIST!!!!!! Umm, these two statements are essentially opposites. The first says that you want "counted strings" as a general Ada feature, and then you say you don't want that. WTF? >I also believe that educators will welcome such a move. Especially >those who remember Turbo Pascal. Packages Ada.Strings.Bounded and Ada.Strings.Unbounded (especially the latter) provide easy-to-use string operations, and have since Ada 95. You might want to explain what you find wrong with them, and why a very expensive built-in mechanism is needed instead. (This sort of change has to clear a very high bar, because it is expensive for everyone: the Ada Standard, Ada implementers, Ada educators, and Ada users [because of additional possibilities to consider when reading Ada code].) Otherwise, we most likely will RESIST the temptation to spend any more time on this comment at all. :-) *************************************************************** From: Tucker Taft Sent: Monday, October 2, 2017 2:27 PM Randy, "WTF" is probably not appropriate for Ada Comment. This guy must have really gotten under your skin! *************************************************************** From: Randy Brukardt Sent: Monday, October 2, 2017 2:35 PM I thought I'd removed that, but apparently I'd used it twice. I'm not sure "What the heck?" would be much better, and I am pretty confused by the entire comment. Especially when he says we have to do something and not do something at the same time. One has to be able to understand a comment before one can process it! *************************************************************** From: Adam Beneschan Sent: Monday, October 2, 2017 5:38 PM It stands for "Why this feature?", right? :) *************************************************************** From: Jeff Cousins Sent: Monday, October 2, 2017 4:07 PM I thought Ada strings were counted strings, i.e. the length is passed with the string, as opposed to C strings where you have to search for a delimiter to get the length. *************************************************************** From: Gautier de Montmollin Sent: Monday, October 2, 2017 7:45 PM > I thought Ada strings were counted strings, i.e. the length is passed with >the string, as opposed to C strings where you have to search for a delimiter >to get the length. The request's author means by "counted string" a Turbo Pascal String, which happens to be an Ada 95+ Bounded_String (see extensive discussion in comp.lang.ada). *************************************************************** Editor's note: The commenter privately sent me a note saying that he was going to drop the topic because "people don't understand the point and get sidetracked." Thus the topic is filed here. ***************************************************************