Re: Data table text I/O package?



On Fri, 1 Jul 2005 20:54:18 -0500, Randy Brukardt wrote:

> And if you don't know what you are analyzing for, Ada is hardly the
> programming language to be using. (Unless you're a hard-core Ada nut [a
> category that I qualify in]; but then you hardly need advice from this
> group.) You need a much more dynamic language, perhaps even those Unix
> filters.

I think it depends. I have a quite opposite experience. I'm lazy and always
start to write a UNIX script. After a couple of hours fighting with that
mess I note (usually to late) that to write it in Ada (or even in ANSI C)
would take twice as short.

> For instance, there isn't a way to search for an unbounded string in another
> unbounded string. [TF puts pretty much everything into lists of unbounded
> strings, because it's impossible to predict what sort of string lengths
> items will have.] You have to use To_String to convert to a regular string,
> which is ugly (especially without use clauses):

Yes.

All built-in string types should have a common ancestor.
Ada.Strings.Unbounded was and remains an ugly hack.

> if Ada.Strings.Unbounded.Index (Ada.Strings.Unbounded.Translate
> (Current.Line, Ada.Strings.Maps.Constants.Lower_Case_Map),
> Ada.Strings.Unbounded.To_String (Pattern.Line)) /= 0 then

I'm using a table of tokens instead. The string is matched against the
table for a longest token that matches. And I always use anchored search. I
tend to do everything in one pass and Ada fits here well.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages

  • Re: The future of Ada is at risk
    ... working under Mac OS X. ... People should have the opportunity to "give Ada a spin" free of charge, ... I don't see how simple but powerful string handling ... I think that the default string type should be the unbounded string, ...
    (comp.lang.ada)
  • Re: How come Ada isnt more popular?
    ... Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm ... Perhaps if the central string were a number? ... But when I compare a book on expert systems written in C and one written in Ada (well, Ada83), the book in Ada is both thicker and has more pages devoted to code than the book in C, and the expert systems are approximately of equivalent power. ...
    (comp.lang.ada)
  • Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... In Ada I could use Ada.Strings.Bounded_Strings ... not at all convinced that two separate string classes are necessary to ... allocator that only ever allocates a block of the initially-specified ... And thead save means that an exception may be ...
    (comp.lang.ada)
  • Re: Interpretation of extensions different from Unix/Linux?
    ... the use of UTF-8 in this way is the recommendation of the ARG. ... (UTF-8 is a problem of its own in Ada. ... a UTF-8 encoded string is a String. ... You can't enumerate roots in Windows, ...
    (comp.lang.ada)
  • Re: String Problem
    ... Ada is a superb programming language, you say, ... Decent answers would encourage the newbie to study Ada more. ... >> How Inizialize a string to null? ...
    (comp.lang.ada)