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,38c827f7e800d317,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-27 03:30:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed.stueberl.de!teaser.fr!enst.fr!not-for-mail From: "Andrew" Newsgroups: comp.lang.ada Subject: conversion Date: Fri, 27 Jun 2003 04:51:04 -0600 Organization: ENST, France Message-ID: NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1056709819 21804 137.194.161.2 (27 Jun 2003 10:30:19 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 27 Jun 2003 10:30:19 +0000 (UTC) To: Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.3718.0 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3718.0 X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:39804 Date: 2003-06-27T04:51:04-06:00 I am experimenting with Ada as the primary language in our process. It seems that the use of String and Unbounded_String require converting from one to the other in order to read a line from a file and then trim it or slice it or tokenize it. For now, regardless of the performance of these conversions it is rather inconvenient to design for a language that does not have a "universal" string type. For instance: a variable of type char * can be used as char * or as char [] and char [] can be used as char *. A fixed string in Ada (to me) is like declaring a char [], you must specify a size at compile time. An unbounded_string in Ada is like char *, it can take on a different size when it appears on the LHS of an assignment operator. 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. I defined a string pointer type so that I could dynamically create strings that are the fixed string type but I find that 'that' only defers the need to convert from fixed string to unbounded_string to different points in the design or that the conversion is not eliminated. I am now thinking that for my company we could develop a "library" that has a "universal" string type. If we don't base it on the defined string in package standard and can use streams to read from files then we can define our own string type. I think... I'm not real sure whether to extend on the functionality of ada.text_io or to create new functionality from the stream package. Any recommendations? Has anyone done something like this? Andrew