[Issue 3224] New: std.random documentation bugs

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3224

   Summary: std.random documentation bugs
   Product: D
   Version: future
  Platform: All
OS/Version: All
Status: NEW
  Keywords: spec
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: k...@kmonos.net


 struct LinearCongruentialEngine(UIntType,UIntType a,UIntType c,UIntType m);
 bool empty;
 Always true (random generators are infinite ranges).

should be Always false

 alias MinstdRand0; 
 alias MinstdRand;
 Example:
 // seed with a constant
 auto rnd0 = MinstdRand0(1);
 auto n = rnd0.popFront; // same for each run
 // Seed with an unpredictable value
 rnd0.seed(unpredictableSeed);
 n = rnd0.popFront; // different across runs

should call .front, instead of .popFront (twice).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3224] std.random documentation bugs

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3224


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||and...@metalanguage.com
 AssignedTo|nob...@puremagic.com|and...@metalanguage.com




-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2697] [DMC too] Cast of float function return to ulong or uint gives bogus value

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2697





--- Comment #4 from Don clugd...@yahoo.com.au  2009-08-04 00:27:08 PDT ---
The evil is done in cdcnvt() in cod4.c, just after this bit...

case OPf_d:
case OPd_f:

/* if won't do us much good to transfer back and*/
/* forth between 8088 registers and 8087 registers*/

So it elides the conversion.
This comment, and the transformation it performs, is false in the case where
the OPf_d is followed a conversion from double to uint or ulong (OPd_u32 or
OPd_u64). This is because the C functions which perform the conversion expect
the double to be in EDX:EAX: ie, it genuinely needs to be converted to double.

Conversions from float to uint work on Linux because a different function is
called, which expects the double to be passed in ST0. They work on DMC Windows
because the conversion gets inlined.

Before presenting a patch, I'd like to make sure that there aren't any other
failing cases.

Could someone please check whether conversions from float to ulong work on
Linux?
(I'm surprised by the comment that it works on Linux, I would expect it to
fail).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2697] [DMC too] Cast of float function return to ulong or uint gives bogus value

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2697


Lars T. Kyllingstad bugzi...@kyllingen.net changed:

   What|Removed |Added

 CC||bugzi...@kyllingen.net




--- Comment #5 from Lars T. Kyllingstad bugzi...@kyllingen.net  2009-08-04 
01:14:48 PDT ---
This is the output I get from running Stewart's program with DMD 2.031 on Linux
(64-bit, although since DMD is 32-bit it probably doesn't matter):

float:  5.00
ulong:  9223372036854775808
long:   5
uint:   5
int:5
ushort: 5
short:  5
ubyte:  5
byte:   5
float:  5.00
ulong:  5
long:   5
uint:   5
int:5
ushort: 5
short:  5
ubyte:  5
byte:   5

As you suspected, float-uint works, while float-ulong fails.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2697] [DMC too] Cast of float function return to ulong or uint gives bogus value

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2697





--- Comment #6 from Don clugd...@yahoo.com.au  2009-08-04 01:48:40 PDT ---
(In reply to comment #5)
 This is the output I get from running Stewart's program with DMD 2.031 on 
 Linux

 As you suspected, float-uint works, while float-ulong fails.

Awesome! There's several ways to fix this, I'm not sure which is the best.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2702] Declaring struct, assigning rvalue via opAssign in same statement fails silently

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2702


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au




--- Comment #1 from Don clugd...@yahoo.com.au  2009-08-04 02:22:05 PDT ---
I think this is invalid.
Bar bar=1; is a construction, not an assignment.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2152] Parentheses usage inconsistency.

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2152


Rob Jacques sandf...@jhu.edu changed:

   What|Removed |Added

 CC||sandf...@jhu.edu




--- Comment #2 from Rob Jacques sandf...@jhu.edu  2009-08-04 05:48:49 PDT ---
This seems releated to Issue 2409. Also another use case:

void delegate(int) func();

void main() {
func(1);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2409] property is not called

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2409


Rob Jacques sandf...@jhu.edu changed:

   What|Removed |Added

 CC||sandf...@jhu.edu




--- Comment #1 from Rob Jacques sandf...@jhu.edu  2009-08-04 05:47:08 PDT ---
Another similar use case:

void delegate(int) func();
void main() {
func(1);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2282] Struct copy-constructor should call opAssign

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2282


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords|wrong-code  |
 CC||clugd...@yahoo.com.au
   Severity|normal  |enhancement




--- Comment #1 from Don clugd...@yahoo.com.au  2009-08-04 06:44:30 PDT ---
This behaviour is by design. I'm marking it as an enhancement, but it should
probably be closed as invalid. It's definitely not a wrong-code bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 1084] lazy variadic parameters break in strange way

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1084


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords|wrong-code  |accepts-invalid
 CC||clugd...@yahoo.com.au




--- Comment #3 from Don clugd...@yahoo.com.au  2009-08-04 07:31:14 PDT ---
This isn't wrong-code, the bug is in the user's code. Changing to
accepts-invalid.
(Perhaps lazy []... should be illegal?)

On DMD2, it displays:
bug(12): Error: escaping reference to local __arrayArg502
So it's a D1-only issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3225] std.string function name casing

2009-08-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3225


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||and...@metalanguage.com
 AssignedTo|nob...@puremagic.com|and...@metalanguage.com




--- Comment #1 from Andrei Alexandrescu and...@metalanguage.com  2009-08-04 
09:33:38 PDT ---
thanks

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---