[Issue 1985] import expression should return ubyte[] not string

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 11 04:16:32 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1985





------- Comment #5 from aarti at interia.pl  2008-04-11 06:16 -------
Answer to comment #4

This isn't (direct) argument against my proposal. It would be if GC scanning
void[] is fundamentally "good thing". But in fact I don't think that in this
case it is such kind of design decision. (There were already proposals to
change this behavior.)

But in case of reading external files, the problem is that compiler just *don't
know* format of imported file. So IMHO the best thing to do is to reflect this
situation in language, and force user to cast content of file to real type.

In case there will stay default cast to some type in import it is really
difficult to justify which default behavior is better. I agree with Bill that
in most GUI application it would be better to have imported array of bytes. But
you can also think about DB framework in which external file is used to define
schema of database (see: U++ framework written in C++). In this case some text
format is much more natural...


-- 



More information about the Digitalmars-d-bugs mailing list