On 2005-04-08, Scott Moore <scott.moore6@[EMAIL PROTECTED]
> wrote:
> Andy Ball wrote:
>>
>> Hello,
>>
>> My Pascal book is very old, and makes no mention of string
>> datatypes other than an 'array of char'. Were strings part
>> of ISO Pascal? What string-related functions were included?
>>
>> Thanks,
>> - Andy Ball.
>
> Neither Wirths original Pascal language, nor ISO 7185 included what
> you are referring to as "string" functions, which are actually more
> correctly defined as "Basic language string functions".
I don't see this. Basics are typically interpreted, and so are their
string types. The pascal dialects strings aren't. Later standards even
got one (though based on schemata)
> The language C/C++ does not have string functions either, to this day.
C++ STL has a string base class.
> A Basic mode string is a relatively expensive data structure, and often
> the same character handling can be done with a simple array of
characters.
> You can use an array of characters to build up essentially the same
> complexity as Basic strings, so you are effectively losing little.
Could you explain why UCSD strings are more expensive than the standard
pascal construct? Specially since retrieving the length (which is needed
in
nearly every string routine) is a lot cheaper, than either in padded or
zero
terminated form?
> Adding Basic strings to Pascal was done in UCSD Pascal in the 1970's.
> It was certainly a popular feature. However, the positioning of
> Pascal as a Pascal+Basic amalgamation certainly didn't help the
> image of Pascal as being a professional programmers language.
I never in 17 years of TP heard a relation between TP strings and Basic.
You are
the first to make that connection, and to my knowledge the only one.
> C never had strings built in, and there have been few complaints,
> mostly I suspect because the average C programmer is capable of making
> his/her own string handling functions.
And causes horrible bufferoverflows in the process.


|