July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Mon, 06 Jul 2009 00:11:26 -0700, Walter Bright wrote: > Derek Parnell wrote: >> I'm struggling to see why the compiler cannot just disallow any signed<->unsigned implicit conversion? Is it a matter of backward compatibility again? > > What's the signed-ness of 5? Positive. A positive number can be assigned to an 'int' if there is no size issue. What's the problem that I'm obviously missing? > When you index a pointer, is the index signed or unsigned? An index can be either. What's the problem here? -- Derek Parnell Melbourne, Australia skype: derek.j.parnell |
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tim Matthews | Tim Matthews wrote:
> grauzone wrote:
>> Walter Bright wrote:
>>> のしいか (noshiika) wrote:
>>>> Thank you for the great work, Walter and all the other contributors.
>>>>
>>>> But I am a bit disappointed with the CaseRangeStatement syntax.
>>>> Why is it
>>>> case 0: .. case 9:
>>>> instead of
>>>> case 0 .. 9:
>>
>> Or
>> case [0..10]:
>> ?
>>
>> Compatible to how list slicing works.
>>
>> Ah yes, bikeshed issue, but my solution is more beautiful.
>>
>> Also, Walter, did you ever think about doing something about the fall-through-by-default issue? Of course in a way that preserves C compatibility.
>
> Do u mean this http://digitalmars.com/d/2.0/statement.html#FinalSwitchStatement
No. Also, this final switch feature seems to be only marginally useful, and normal switch statements do the same, just at runtime. So much for "more pressing issues" but it's his language and not mine so I'll shut up.
|
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Mon, 06 Jul 2009 12:19:47 +0400, Walter Bright <newshound1@digitalmars.com> wrote:
> MIURA Masahiro wrote:
>> Thanks for the new release! Are case ranges limited to 256 cases?
>
> Yes.
Does it compare on case-by-case basis? Up to 256 comparisons?
|
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Mon, 06 Jul 2009 09:05:10 +0400, Walter Bright <newshound1@digitalmars.com> wrote:
> Something for everyone here.
>
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.046.zip
>
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.031.zip
Someone's clock must have stopped at May, 14 - that's what being show as a D2.031 release date (although "Last update Sun Jul 5 01:18:49 2009")
You may want to check D1.046 released date, too.
|
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Koroskin | Denis Koroskin wrote:
> Does it compare on case-by-case basis? Up to 256 comparisons?
What do you mean? Obj2asm will show what it is doing.
|
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> Something for everyone here.
>
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.046.zip
>
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.031.zip
The dmd2 phobos seem to have a directory
replaced with a file, for std.c.osx.socket ?
std/socket.d(79): Error: module socket cannot read file 'std/c/osx/socket.d'
std/c/osx -> std/c/osx/socket.d
Ran into some Makefile issues as well,
reported as bugzilla #3140 and #3141.
--anders
|
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | Derek Parnell wrote: > On Mon, 06 Jul 2009 00:11:26 -0700, Walter Bright wrote: > >> Derek Parnell wrote: >>> I'm struggling to see why the compiler cannot just disallow any >>> signed<->unsigned implicit conversion? Is it a matter of backward >>> compatibility again? >> What's the signed-ness of 5? > > Positive. A positive number can be assigned to an 'int' if there is no size > issue. It can also be an unsigned. > What's the problem that I'm obviously missing? > >> When you index a pointer, is the index signed or unsigned? > > An index can be either. What's the problem here? auto x = p1 - p2; What's the type of x? |
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to grauzone | grauzone wrote:
> No. Also, this final switch feature seems to be only marginally useful, and normal switch statements do the same, just at runtime. So much for "more pressing issues" but it's his language and not mine so I'll shut up.
The final switch deals with a problem where you add an enum member in one file and then have to find and update every switch statement that uses that enum. There's no straightforward way to find them to ensure the case gets added to each switch.
It's solving a similar problem that symbolic constants do.
The fall-through thing, though, is purely local and so much less of an issue.
|
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Mon, 06 Jul 2009 14:13:45 +0400, Walter Bright <newshound1@digitalmars.com> wrote:
> Derek Parnell wrote:
>> On Mon, 06 Jul 2009 00:11:26 -0700, Walter Bright wrote:
>>
>>> Derek Parnell wrote:
>>>> I'm struggling to see why the compiler cannot just disallow any
>>>> signed<->unsigned implicit conversion? Is it a matter of backward
>>>> compatibility again?
>>> What's the signed-ness of 5?
>> Positive. A positive number can be assigned to an 'int' if there is no size
>> issue.
>
> It can also be an unsigned.
>
>> What's the problem that I'm obviously missing?
>>
>>> When you index a pointer, is the index signed or unsigned?
>> An index can be either. What's the problem here?
>
> auto x = p1 - p2;
>
> What's the type of x?
ptrdiff_t, signed counterpart of size_t
|
July 06, 2009 Re: dmd 1.046 and 2.031 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Koroskin | Denis Koroskin wrote:
>> auto x = p1 - p2;
>>
>> What's the type of x?
>
> ptrdiff_t, signed counterpart of size_t
Do you really want an error if you go:
size_t y = p1 - p2;
?
|
Copyright © 1999-2021 by the D Language Foundation