Re: Just say 'YES' to strings (or not?)
irv mullins wrote:
>
> Work like keeping track of pointers, garbage collection, etc.
> Euphoria's selling points include "No pointers to run wild"
> and "automatic garbage collection". Shouldn't those also be the
> programmer's 'prerogative'? Do we want to do away with them?
> How about integer types - should they go too?
>
> But if those are 'good things', then why is having a string type -
> which keeps "John" from printing out as {74,111,104,110} suddenly
> a bad thing?
>
This seems like a convenience issue to me. Or maybe I'm not clear as to
what the issue is, but it reminds me of the type checking discussions that
pop up here every so often, where the question always comes up: What is
the purpose of type checking?
Are you concerned that you can't keep track of the data type when you try
to output it? I understand the complexities of printf can be daunting
(it took me several months to figure it out, IIRC), but I don't see
having a string type as being very useful. puts() handles 'simple' output
requirements. No, it doesn't handle nested sequences, but those aren't
really strings anyways. For that problem, you'd need to introduce typed
sequence elements first, which is a whole nother ball o' wax. But there
are several pretty print options out there now (one of which comes with
Euphoria), so I don't think this is a big issue.
This pro-string argument seems to say that the main reason for having
a string type is that it helps us remember how it should be outputted,
and maybe saves us some typing in the way of a printf() call.
I really like being able to treat my strings as not-strings (which maybe
we would still be able to do in a Eu-with-strings, so that may not
be a valid objection), as opposed to using specialized string functions,
and not being able to use the ASCII values as numbers without any
conversion.
As stated before, my principle objection is that a new primitive datatype
would wreck Rob's data scheme, and the optimizations that we get because
of it. I suppose that when Euphoria goes [completely] 64-bit, we could
have more datatypes that used the same model, and so maybe that objection
goes away.
Matt Lewis
|
Not Categorized, Please Help
|
|