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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5117b1b6391a0e06 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!news.agarik.com!news.agarik.com!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Alexander E. Kopilovich" Newsgroups: comp.lang.ada Subject: Re: A simple ADA puzzle (I haven't the answer) Date: Thu, 17 Jun 2004 02:48:09 +0400 (MSD) Organization: Cuivre, Argent, Or Message-ID: References: <1087410710.477506@master.nyc.kbcfp.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1087426049 22163 212.85.156.195 (16 Jun 2004 22:47:29 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 16 Jun 2004 22:47:29 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <1087410710.477506@master.nyc.kbcfp.com>; from Hyman Rosen at Wed, 16 Jun 2004 14:31:50 -0400 X-Mailer: Mail/@ [v2.44 MSDOS] X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:1591 Date: 2004-06-17T02:48:09+04:00 Hyman Rosen wrote: > trying to handle strings in Ada is a nightmare This is true, and I tried to convey this truth here in comp.lang.ada from time to time in past years, but without any visible success. > if you don't understand a lot about arrays and types and > constraints. Yes, this is required, but still not enough - you should also agree with that you'll be constantly reminded by the language that strings are arrays and therefore you generally can't deal with them as with scalars (you can do that in Pascal, and you often can mimic that in C - using pointers). The problem is that Ada designers did not recognize in proper time that strings aren't exactly arrays, and that in growing number of applications thinking of strings as of arrays is no more natural than thinking of numbers as of arrays of bits. A workaround is to use Unbounded_Strings only, but then you'll have a trouble every time when fixed-length string is expected; and you'll be oblidged to submit a petition every time when you need to initialize that string with a literal. > New Ada users, especially those coming from C > or Java, are going to be utterly confused. As well as those coming from Pascal/Delphi. But there is an environment, in which handling of strings is even more (at least no less) gorgeous/complicated than in Ada - it is Symbian OS (I mean C++ SDKs for Symbian), which is used in majority of high-end smartphones today (Nokia, SonyEricsson, etc.) . Alexander Kopilovich aek@vib.usr.pu.ru Saint-Petersburg Russia