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: 103376,38c827f7e800d317 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-04 19:40:03 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: aek@vib.usr.pu.ru (Alexander Kopilovitch) Newsgroups: comp.lang.ada Subject: Re: conversion Date: 4 Jul 2003 19:40:03 -0700 Organization: http://groups.google.com/ Message-ID: References: <3EFCC18B.4040904@attbi.com> NNTP-Posting-Host: 195.242.17.22 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1057372803 31718 127.0.0.1 (5 Jul 2003 02:40:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 Jul 2003 02:40:03 GMT Xref: archiver1.google.com comp.lang.ada:40070 Date: 2003-07-05T02:40:03+00:00 List-Id: Robert I. Eachus wrote: >... The situation in Ada is exactly the same with integer >and string types. But the situation in applications is not the same. >... The Ada.Strings.Bounded and Ada.Strings.Unbounded packages provide a way to >create objects that have only a maximum or no minimum and no maximum >length respectively. The equivalent for integer types is a bignum >package, which supports any size integer value without Constraint_Error. So, Unbounded_String corresponds to bignum. Good, I may even like this analogy. But imagine that Ada language once becomes somehow more popular (well, not so popular as Visual Basic or even C++ -:) . How many programmers will need bignum package? Very tiny fraction (and I think that even now the same is true). But most of programmers that use (even moderately) widespread language will need Unbounded_String. The varying strings of unspecified maximum size are common for many applications outside of current, quite restricted Ada world. And arrays of such strings are no less common. And I'm sure that at least initialization with literals must be provided directly, without any explicit conversions. I can imagine that most often there are ways (of which I'm not aware) to avoid heavy use of Unbounded_Strings. If this is true then I wish this ways be explained -- for programmer, not for language lawyer - in some book (or at least in comprehensive article) dedicated to this issue. Dmitry A. Kazakov wrote: >So instead of looking for explanations which I doubt would convince >anybody, one could simply admit that, yes, String and Unbounded_String >should be better siblings, but to do it consistently would require too >many changes Ada's ADT model. I tried (about year ago, I think) to propose (in Ada-Comment) a construct for this purpose: type Y is private envelope of X; which should lead to type Unbounded_String is private envelope of String; This my proposition did not sink in silence, I was faced with a list of remarks and questions... I tried to respond for them, but failed miserably, due to lack of language lawyer skills and experience. Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia