if(bool = x) does not give a boolean result

2010-05-07 Thread Steven Schveighoffer
I have code like this in dcollections: /** * Removes the element that has the given key. Sets wasRemoved to true if the * element was present and was removed. * * Runs on average in O(1) time. */ HashMap remove(K key, out bool wasRemoved) {

Re: if(bool = x) does not give a boolean result

2010-05-07 Thread Graham Fawcett
On Fri, 07 May 2010 07:56:23 -0400, Steven Schveighoffer wrote: I have code like this in dcollections: /** * Removes the element that has the given key. Sets wasRemoved to true if the * element was present and was removed. * * Runs on average in O(1) time.

Re: if(bool = x) does not give a boolean result

2010-05-07 Thread Steven Schveighoffer
On Fri, 07 May 2010 08:02:00 -0400, Graham Fawcett fawc...@uwindsor.ca wrote: On Fri, 07 May 2010 07:56:23 -0400, Steven Schveighoffer wrote: I have code like this in dcollections: /** * Removes the element that has the given key. Sets wasRemoved to true if the * element

Re: Export values (enum, int, char[]...) for DLL

2010-05-07 Thread Nrgyzer
torhu Wrote: On 06.05.2010 16:06, Nrgyzer wrote: Thanks, but doesn't work :( My files contain: mydll.d: module mydll; export extern int i; mydll2.d: module mydll; export int i = 7; test.d: import mydll; import std.stdio; void main() { writefln(i);

Re: Assertion failure: 'fieldi=0 fieldi se-elements-dim' on line 2062 in file 'interpret.c'

2010-05-07 Thread strtr
Not feeding a float to ToString! seems to bring it back to life. What is up with that anyway? How do I output a float in compile time?

Re: Assertion failure: 'fieldi=0 fieldi se-elements-dim' on line 2062 in file 'interpret.c'

2010-05-07 Thread Don
strtr wrote: Killed it again :( Are you using the latest DMD? If so, please try to create a test case, as this bug has never been reported before. Thanks!

Re: if(bool = x) does not give a boolean result

2010-05-07 Thread bearophile
Steven Schveighoffer: I have code like this in dcollections: This is similar code that shows the same thing: import std.stdio; void main() { bool b = true; bool c; if (c = !b) writeln(); } Since when did bool = bool not give a bool result? I guess since Walter has

Re: if(bool = x) does not give a boolean result

2010-05-07 Thread Johan Granberg
bearophile wrote: Steven Schveighoffer: I have code like this in dcollections: This is similar code that shows the same thing: import std.stdio; void main() { bool b = true; bool c; if (c = !b) writeln(); } Since when did bool = bool not give a bool

Re: if(bool = x) does not give a boolean result

2010-05-07 Thread Steven Schveighoffer
On Fri, 07 May 2010 14:42:15 -0400, Johan Granberg lijat.me...@ovegmail.com wrote: This is all true but if this is how the feature should be defined I think the error message should improve. Something along the lines of, Assignments not allowed as thruth values in conditional statments seems