comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Question on bounded / unbounded strings
Date: Thu, 22 Sep 2016 19:13:12 +0200
Date: 2016-09-22T19:13:12+02:00	[thread overview]
Message-ID: <ns13fg$1r9r$1@gioia.aioe.org> (raw)
In-Reply-To: dcd6541e-4574-46c9-b8cb-6cdb9616a9ab@googlegroups.com

On 2016-09-22 16:51, Maciej Sobczak wrote:
>>> I don't know about you, but I seem to be surrounded by bounded strings.
>>
>> Do you use Ada bounded strings?
>
> I don't use Ada for such applications. :-)
> (in a sense, bounded strings in Ada are useless for the majority of programmers...)
>
> Yes, I have used char[N] in "other languages" on various occasions.
> These are bounded strings.

How char[N] is? It is compatible with char[M].

>>> Splitting strings is inefficient for you? It is very efficient for
>>> me  to split the string and pass its individual parts to separate tasks for
>>> parallel processing. If you are doing the string splitting by traversing
>>> the string and storing the tokens aside,
>>
>> Why would you store them? In the example you gave, I would pass them
>> straight to a worker task as soon as I get one.
>
> This is a secondary issue. You are still splitting the string.

No. Splitting is an operation resulting in a set of strings, as a 
compound object. Scanning does not produce such objects, though it could 
if necessary. The point is that this object is almost never necessary.

> And no, I would rather store them in a job queue.

Job queue is not a set of strings.

>> Not if substrings get processed,
>
> Yes if they are not processed.

They are, as you said, the result is a job queue not a set of strings.

> Please do not invent artificial argument extensions only to "prove" your point.

Just defining terms. If you consider scanning, translating, etc same as 
tokenizing because the application in the end does the same, there is 
nothing to discuss. Then Ada is C and C is Ada.

>> The point
>> is that the operation of splitting as such is pointless because its
>> result has no value of its own
>
> No, the result of splitting has a real value of its own. Get the
> spreadsheet and split it into individual cells - they are still real
> values. They might even be still useful in another spreadsheet.

String is not spreadsheet and conversely.

>> it is an intermediate which can and must
>> be dropped for the sake of simplicity and efficiency.
>
> There is no reason to drop a data value that is needed for further processing.

Nobody dropped values required processing. Values of tokens /= Value of 
a set of tokens. Values are processed without explicit construction of a 
set of.

>>> Unbounded_String? Can be very useful as a sink for generated data in
>>> whatever format.
>>
>> Nope. That thing is called stream.
>
> Nope. Stream is a high-level I/O abstraction that is not needed
> here.

You argue for a poor implementation (Unbounded_String) of this abstraction.

> Progressive accumulation of value is called "append" and
> Unbounded_String has the right interface for this.

Yes, "Append" could implements stream's "Write". So what? If the output 
is generated in a raw form that is stream. Not frequently used, but 
Unbounded_String would be a poor choice, as always. There is no much use 
of Unbounded_String. One is passing in-out parameters for a procedure. 
Another is having arrays and records with string components.

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


  reply	other threads:[~2016-09-22 17:13 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  8:46 Question on bounded / unbounded strings Arie van Wingerden
2016-09-13  9:04 ` Dmitry A. Kazakov
2016-09-22  2:10   ` John Smith
2016-09-22  7:24     ` Dmitry A. Kazakov
2016-09-22  9:01       ` J-P. Rosen
2016-09-22  9:53         ` Dmitry A. Kazakov
2016-09-22 10:58           ` G.B.
2016-09-22 12:05             ` Dmitry A. Kazakov
2016-09-22 14:14               ` G.B.
2016-09-22 17:18                 ` Dmitry A. Kazakov
2016-09-22 11:08           ` J-P. Rosen
2016-09-22 12:05             ` Dmitry A. Kazakov
2016-09-22 13:18           ` Maciej Sobczak
2016-09-22 13:52             ` Dmitry A. Kazakov
2016-09-22 14:51               ` Maciej Sobczak
2016-09-22 17:13                 ` Dmitry A. Kazakov [this message]
2016-09-23  5:50                   ` Maciej Sobczak
2016-09-23  6:36                     ` Simon Wright
2016-09-23  7:48                       ` Dmitry A. Kazakov
2016-09-28 20:55                     ` Randy Brukardt
2016-09-23 23:58       ` John Smith
2016-09-24  7:52         ` Dmitry A. Kazakov
2016-09-24 16:25           ` John Smith
2016-09-24 17:44             ` Dmitry A. Kazakov
2016-09-24 18:33               ` John Smith
2016-09-24 18:37               ` John Smith
2016-09-24 18:59               ` John Smith
2016-09-25  8:50                 ` Dmitry A. Kazakov
2016-09-25 23:35                   ` brbarkstrom
2016-09-26  7:28                     ` Dmitry A. Kazakov
2016-09-26 12:39                       ` brbarkstrom
2016-09-28 21:09             ` Randy Brukardt
2016-09-30  7:59               ` Björn Lundin
2016-09-13  9:35 ` gautier_niouzes
2016-09-13 10:41 ` Alejandro R. Mosteo
2016-09-13 17:41 ` Jeffrey R. Carter
2016-09-13 17:59 ` Björn Lundin
2016-09-14 11:23 ` Arie van Wingerden
2016-09-14 12:26   ` Arie van Wingerden
2016-09-14 12:28   ` Arie van Wingerden
2016-09-14 12:57 ` Arie van Wingerden
2016-09-14 19:39   ` Jeffrey R. Carter
2016-09-17 16:35     ` Arie van Wingerden
2016-09-16 14:43 ` Olivier Henley
2016-09-17 16:35   ` Arie van Wingerden
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox