March 17, 2005 Re: initial values (OT) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Black | Craig Black wrote:
>>actually that is a bug in dmd since the spec says dynamic arrays are filled with the default value when resized.
>
> I don't know if I like the idea of needlessly initializing large arrays to unusable values. Wouldn't this have a significant adverse effect on performance? Perhaps this could be a compiler option.
At least allocating them as "zero" would be both fast and usable... ?
I think the arrays are right, and that the .init values need changing.
--anders
|
March 17, 2005 Re: initial values | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | Ben Hinkle wrote: >>>All I'm asking for is consistency - either all unusable or all usable. With a preference for making them usable. >> >>Consistency seems to be a big deal lately :-) Not sure we're getting it. > > Please don't lump this in with length, if that is what you mean. :-P Well, there's been several "lacks of consistancy" over my time here. The latest one was _arguments versus __FILE__, that is correct... Then there was "bit" versus "true" and "false" (which *still* sucks) http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11757 And there was the lack of std.stdio.readf and std.string.unformat. Plus the lack of a "isnot", even though === was replaced with "is" ? http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/14705 How bitfields are now totally lame, but how bit arrays rules the world. ... Little things like that. Some of them petty, some of them disturbing... Obviously I like D a lot, or I wouldn't bother with these trivialities. But me too hopes the .init values can be changed into more convenient. And that the definition of void main can be settled, once and for all. --anders |
March 17, 2005 Re: initial values | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | In article <d1cijj$1i10$2@digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says... > >And there was the lack of std.stdio.readf and std.string.unformat. I wrote a version of this ages ago. I haven't tested it since perhaps release 96, but it's available here: http://home.f4.ca/sean/d/stdio.zip I never submitted it to Walter because I was waiting for typeinfo to improve for pointers so I could tune it a bit first. It also needs some testing with wide characters, since putback may potentially have to put back up to 4 bytes at the end of the read process. Sean |
March 17, 2005 Re: initial values (stdio) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | Sean Kelly wrote:
>>And there was the lack of std.stdio.readf and std.string.unformat.
>
> I wrote a version of this ages ago. I haven't tested it since perhaps release
> 96, but it's available here:
>
> http://home.f4.ca/sean/d/stdio.zip
>
> I never submitted it to Walter because I was waiting for typeinfo to improve for
> pointers so I could tune it a bit first. It also needs some testing with wide
> characters, since putback may potentially have to put back up to 4 bytes at the
> end of the read process.
I actually just updated this, that was why I mentioned it.
See my other post, titled "readf and unformat (updated)" ?
It's working great, but TypeInfo is broken - especially on GDC...
The workaround you used only works on "_arguments", not on copies.
I renamed your "sreadf" as std.string.unformat instead,
and changed the definitions of getc/ungetc to use EOF...
--anders
|
Copyright © 1999-2021 by the D Language Foundation