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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 11 13:18:04 PDT 2008


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





------- Comment #8 from wbaxter at gmail.com  2008-04-11 15:18 -------
(In reply to comment #7)
> I think I understand your way of thinking. But the problem here is 
> different. With void[] you can not do anything, so you have to cast. 
> With ubyte[] you can use data as they are, because they have in fact 
> specific type. 

Well, it's a specific type that represents raw memory.

But I get your point too.  If there were a void_without_pointers type that
couldn't be used without casting, then I'd be happy for import("file") to use
that.  But with void[] getting scanned by the gc for pointers it's a no-go.  If
you do just one import("big_binary_file") it could add enough false pointers
that your app would hold on to big gobs of memory it doesn't need to.


-- 



More information about the Digitalmars-d-bugs mailing list