Re: Is integer overflow defined?

2011-09-01 Thread bearophile
Timon Gehr: > according to TDPL p53., that fact is defined. (unary minus: -x == ~x+1) Uh. Bye, bearophile

Re: opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Timon Gehr
On 09/02/2011 12:09 AM, Damian Ziemba wrote: On Thu, 01 Sep 2011 13:59:29 +0200, Timon Gehr wrote: static assert(isInputRange!Test); static assert(isInputRange!Test2); toString is not shadowed, but the implementation of writeln assumes that your types are an InputRange (they provide, by the me

Re: opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Damian Ziemba
On Thu, 01 Sep 2011 13:59:29 +0200, Timon Gehr wrote: > static assert(isInputRange!Test); > static assert(isInputRange!Test2); > > toString is not shadowed, but the implementation of writeln assumes that > your types are an InputRange (they provide, by the means of opDispatch, > front(), empty()

Re: Is integer overflow defined?

2011-09-01 Thread Sean Eskapp
== Quote from Timon Gehr (timon.g...@gmx.ch)'s article > On 09/01/2011 06:20 PM, Sean Eskapp wrote: > > Is integer overflow defined (for instance, as being mod 2^size)? > I am quite sure that all operations are defined as operations on two's > complement integers, which would mean overflow is defin

Re: gdc setup without gcc

2011-09-01 Thread Jérôme M. Berger
%u wrote: > I have 2 issue: > 1- i can't install the package, there is problem I don't know what is it? What is the error? > 2-it is not updated. It is not flagged out of date either. AFAIK it should compile and since it downloads the latest source from Mercurial, there is no need

Re: Is integer overflow defined?

2011-09-01 Thread Timon Gehr
On 09/01/2011 06:20 PM, Sean Eskapp wrote: Is integer overflow defined (for instance, as being mod 2^size)? I am quite sure that all operations are defined as operations on two's complement integers, which would mean overflow is defined, but I cannot find the respective part of the specificat

Is integer overflow defined?

2011-09-01 Thread Sean Eskapp
Is integer overflow defined (for instance, as being mod 2^size)? Can I reliably say that -long.min == 0L?

Re: gdc setup without gcc

2011-09-01 Thread Alex Rønne Petersen
On 01-09-2011 08:35, %u wrote: I have 2 issue: 1- i can't install the package, there is problem I don't know what is it? 2-it is not updated. It would probably help to post the error... - Alex

Re: Why does std.range.zip use emplace instead of simple assignments?

2011-09-01 Thread Timon Gehr
On 09/01/2011 10:23 AM, David Nadlinger wrote: It might well be that I'm missing something obvious in the emplace() overload jungle, but what is the reason for std.range.zip to use std.conv.emplace for assigning the range elements to the »output« elements instead of just using the assignment oper

Re: opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Timon Gehr
On 09/01/2011 09:34 AM, Damian Ziemba wrote: Greetings. I've been playing around with opDispatch and toString methods and I found strange behavior. Example: import std.stdio; struct Test { string opDispatch( string key )() {

Re: opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Damian Ziemba
On Thu, 01 Sep 2011 07:56:49 +, Christophe wrote: > Try to create the method: > > const void toString(void delegate(const(char)[]) sink, string > formatString) { > sink(toString()); > } Adding it as it is results in compiler error: ./quick.d(30): Error: function quick.Test2.toStrin

Why does std.range.zip use emplace instead of simple assignments?

2011-09-01 Thread David Nadlinger
It might well be that I'm missing something obvious in the emplace() overload jungle, but what is the reason for std.range.zip to use std.conv.emplace for assigning the range elements to the »output« elements instead of just using the assignment operator? https://github.com/D-Programming-Langu

Re: opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Christophe
Try to create the method: const void toString(void delegate(const(char)[]) sink, string formatString) { sink(toString()); }

opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Damian Ziemba
Greetings. I've been playing around with opDispatch and toString methods and I found strange behavior. Example: import std.stdio; struct Test { string opDispatch( string key )() { return "I am dispatching in struct