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-06-27 10:13:46 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: 27 Jun 2003 10:13:46 -0700 Organization: http://groups.google.com/ Message-ID: References: NNTP-Posting-Host: 62.152.82.103 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1056734026 24899 127.0.0.1 (27 Jun 2003 17:13:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 27 Jun 2003 17:13:46 GMT Xref: archiver1.google.com comp.lang.ada:39832 Date: 2003-06-27T17:13:46+00:00 List-Id: >The catch is that unbounded_string can not be used in context of string. >This posses some design inconveniences and requires converting back and forth >from string to unbounded_string multiple times. Exactly. This is very inconvenient (perhaps, most inconvenient) feature of Ada language. Certainly, a chorus tells you that Ada is not C, but what about Pascal, which has much more resemblance with Ada? Pascal isn't C, it does not rely heavily upon pointers, but at the same time it has quite good and usable strings. The chorus also tells you that in Ada you should not need those conversion too often. Well, they are honest enough, they simply do not use Ada for a job and in an environment where you must mix varying strings and constant strings here and there, and at the same time you can't afford several weeks for design for every change in specifications. Ada simply understimates need of strings in non-numerical world (almost like Fortran IV, that is, before Fortran 77). I'm sure that Ada people would cry very loudly if there were similar situation with Integer type: imagine that there is unconstrained (for value, not for storage size) type Integer, which objects must be constrained (by value). Then, there are types Bounded_Integer and Unbounded_Integer. Unbounded_Integer is good for general use, except that you always have to write explicit conversion when you assign a literal (say, 1 or 0) to an object of Unbounded_Integer type (currently Ada Integer is like a Pascal string in this respect). Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia