[Issue 4672] [patch] rdmd fails when -I is needed

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4672



--- Comment #2 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
00:12:49 PDT ---
Created an attachment (id=726)
Same as above, but in diff form

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


[Issue 4677] New: disallow GC via cmd line argument -nogc

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4677

   Summary: disallow GC via cmd line argument -nogc
   Product: D
   Version: future
  Platform: Other
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: s...@extrawurst.org


--- Comment #0 from Stephan Dilly s...@extrawurst.org 2010-08-19 02:13:24 PDT 
---
just like mentioned in andrei's interview
(http://www.informit.com/articles/article.aspx?p=1622265) i hope to see an dmd
command line argument for disabling and disallowing the use of the GC in DMD:

Walter Bright is considering adding a compile-time flag that would banish all
constructs that make implicit use of the GC, in which case you'll know at
compile time where the culprits are, and you can change your code accordingly

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


[Issue 4652] Compiler hangs on template with zero-length tuple and another argument

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4652



--- Comment #5 from Don clugd...@yahoo.com.au 2010-08-19 04:30:12 PDT ---
That patch was incorrect, it failed to deal with default and variadic
parameters. This new test case incorporates the test case from bug 4676 as
well,
which is also fixed by this patch.
---
void bug4652(U, T...)(long y, T x, U num){}
void bug4652default(T) (T value, int x=2) {}
void bug4652default(T) (T value, int y){ }
void bug4676(T...)(T args, string str) {}
void bug4676(T...)(T args) {}
void instantiate4652()
{
bug4652(2, 'c', 27, 'e', 'f',1); // rejects-valid
bug4652(2, 1);  // infinite loop on valid code
bug4652default(true);
bug4676(1, 2, 3);
}
---


Revised patch. Template.c, line 1090, deduceFunctionTemplateMatch().
==

 #endif

 // Loop through the function parameters
-for (i = 0; i  nfparams; i++)
+for (size_t parami = 0; parami  nfparams; parami++)
 {
 /* Skip over function parameters which wound up
  * as part of a template tuple parameter.
  */
-if (i == fptupindex)
-{   if (fptupindex == nfparams - 1)
-break;
+if (parami == fptupindex)
+continue;
+/* Set i = index into function arguments   
+ * Function parameters correspond to function arguments as follows.
+ * Note that tuple_dim may be zero, and there may be default or 
+ * variadic arguments at the end.
+ *  arg [0..fptupindex] == param[0..fptupindex]
+ *  arg [fptupindex..fptupindex+tuple_dim] == param[fptupindex]
+ *  arg[fputupindex+dim.. ] == param[fptupindex+1.. ]
+ */
+i = parami;
+if (fptupindex = 0  parami  fptupindex)
 i += tuple_dim - 1;
-continue;
-}

-Parameter *fparam = Parameter::getNth(fparameters, i);
+Parameter *fparam = Parameter::getNth(fparameters, parami);

 if (i = nfargs)// if not enough arguments
 {

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


[Issue 3934] Some untidy attributes

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3934



--- Comment #8 from bearophile_h...@eml.cc 2010-08-19 06:14:56 PDT ---
From bernardh on IRC, this program compiles:

auto scope shared import std.stdio;
void main() {}

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


[Issue 4678] New: Built struct is callable without opCall

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4678

   Summary: Built struct is callable without opCall
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: accepts-invalid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-08-19 06:19:14 PDT ---
This D1 program compiles and runs with DMD 2.048:


import std.c.stdio: puts;
struct Foo {
this(int) { puts(THIS); }
}
void main() {
auto bar = Foo(10);
bar(20);
}


The output:
THIS
THIS


So the Foo constructor is run two times. I think this is not correct.

Foo lacks an opCall, so what I expect is a compile-time error that says that
'bar' is not callable.

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


[Issue 4679] New: Problem with final override

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4679

   Summary: Problem with final  override
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-08-19 06:22:41 PDT ---
This D2 program compiles and runs with DMD 2.048 with no errors:


import std.c.stdio: puts;
class Base {
this() { foo(); }
private void foo() { puts(Base.foo); } // called
}
class Derived : Base {
private override void foo() { // not called
puts(Derived.foo);
super.foo();
}
}
void main() {
auto d = new Derived();
}


Output:
Base.foo


If Base.foo() is private then it's final. Then what is Derived.foo()
overriding?

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


[Issue 2195] Variable shadowing is not detected and reported

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2195


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||s...@iname.com
 Resolution||DUPLICATE


--- Comment #1 from Stewart Gordon s...@iname.com 2010-08-19 06:28:38 PDT ---
*** This issue has been marked as a duplicate of issue 47 ***

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


[Issue 47] Entity name shadowing: compiler not acting according to spec.

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=47


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||2kor...@gmail.com


--- Comment #2 from Stewart Gordon s...@iname.com 2010-08-19 06:28:38 PDT ---
*** Issue 2195 has been marked as a duplicate of this issue. ***

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


[Issue 2195] Variable shadowing is not detected and reported

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2195


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
Version|1.00|D1  D2
 Resolution|DUPLICATE   |
   Severity|normal  |regression


--- Comment #2 from Stewart Gordon s...@iname.com 2010-08-19 06:37:15 PDT ---
I was wrong, the bug has come back (1.063 and 2.048, Windows).

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


[Issue 4680] New: Duplicated function/overload error message

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4680

   Summary: Duplicated function/overload error message
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-08-19 06:57:39 PDT ---
This is a wrong D2 program:

int x = 1;
int x = 1;
void main() {}


dmd 2.048 prints a good enough error message:
test.d(2): Error: variable test.x conflicts with variable test.x at test.d(1)


This is another wrong D2 program:


void foo() {}
void foo() {}
void main() {}


But here dmd 2.048 on Windows shows a link error:

OPTLINK (R) for Win32  Release 8.00.2
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
test.obj(test)  Offset 00151H Record Type 00C3 
 Error 1: Previous Definition Different : _D4test3fooFZv


In my opinion here it's better for dmd to spot the function foo() duplication
and give a cleaner error message, something like:

test.d(2): Error: function test.foo() has the same signature as the function
test.foo() at test.d(1)

This bug may happen if a function is duplicated, or if the overloading is done
in a wrong way.

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


[Issue 2451] Adding structs that use opAssign or postblit to an AA is broken

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2451



--- Comment #8 from Don clugd...@yahoo.com.au 2010-08-19 07:23:47 PDT ---
Bug 3705 (Can't add structs with alias this to an AA) is probably related.

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


[Issue 314] [module] Static, renamed, and selective imports are always public

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=314



--- Comment #27 from Don clugd...@yahoo.com.au 2010-08-19 07:39:48 PDT ---
(In reply to comment #24)
 (In reply to comment #20)
  (In reply to comment #19)
   Don, which version of the patch did you apply - the one attached here or 
   the
   one I applied to LDC? 
  
  The one attached here.
 
 Well, as Walter pointed out the attached patch has problems with overload
 resolution. The corrected patch doesn't though. If you're interested in 
 looking
 at it, I could make it work against the D2 frontend and post it here.
 
 I don't want the effort to be in vain though, so could you check with Walter
 whether he'd accept a patch that works as described in comment #9?

From discussion with Walter --
It's too difficult to evaluate the patch in its present form. It's in two
parts, both diffed against the LDC codebase rather than DMD, and the context is
really unclear -- it's not clear which functions are being patched. I don't
think a complete patch is required for evaluation -- in fact, a complete patch
would be  more difficult to quickly understand. But if you can write the
essence of the code here, which I think is really only a couple of functions,
that should be enough. And with a explanation of what it's doing. Leave out the
myriad of changes which are just passing the module handle around.

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


[Issue 4677] disallow GC via cmd line argument -nogc

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4677


Leandro Lucarella llu...@gmail.com changed:

   What|Removed |Added

 CC||llu...@gmail.com


--- Comment #1 from Leandro Lucarella llu...@gmail.com 2010-08-19 08:39:35 
PDT ---
LDC have even better options, you can forbid any calls to the runtime, which
might be very useful for embedded systems or others usages when you only want a
better C for real low-level stuff.

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


[Issue 3934] Some untidy attributes

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3934



--- Comment #9 from bearophile_h...@eml.cc 2010-08-19 09:11:44 PDT ---
This D2 program compiles and runs with DMD 2.048 with no errors, but I think
the compiler has to flag this usage of the 'private final' attributes as
incorrect:


import std.c.stdio: puts;
class Base {
 private final ~this() { puts(Base.~this); }
}
class Derived : Base {
private final ~this() { puts(Derived.~this); }
}
void main() {
new Derived();
}

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


[Issue 4681] New: Strange access violation Mandelbug with AAs + Appender

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4681

   Summary: Strange access violation Mandelbug with AAs + Appender
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: critical
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2010-08-19 10:15:45 PDT ---
The following code produces an access violation approximately 1 in 10 times
when run.  From observations that I haven't been able to reduce to a small test
case, it appears that memory corruption is also involved.  This bug is so
non-deterministic that I haven't the slightest clue how to debug it further. 
It appears related to the order in which the arrays are appended.  I tried
changing this to some simple deterministic things and can't reproduce this bug
w/o the random index selection.

import std.stdio, std.random, std.array;

void main() {
Appender!(float[], float)[string] aa;

string[] indices = [aa, bb, cc, dd, ee, ff, gg, hh, ii];
foreach(i; 0..10_000) {
float f = i;
auto index = indices[uniform(0, indices.length)];

if(index !in aa) {
aa[index] = typeof(aa[index]).init;
}
aa[index].put(f);
}
}

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


[Issue 4681] Strange access violation Mandelbug with AAs + Appender

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4681


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

   Priority|P2  |P1
   Severity|critical|regression


--- Comment #1 from David Simcha dsim...@yahoo.com 2010-08-19 10:51:27 PDT ---
Can't reproduce this in 200 attempts on 2.047, whereas in 200 attempts on 2.048
I get 32 access violations.  It's a regression, and a pretty severe one.

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


[Issue 4681] Strange access violation Mandelbug with AAs + Appender

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4681


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com


--- Comment #2 from kenn...@gmail.com 2010-08-19 11:11:21 PDT ---
Reproduced on Mac OS X (v2.048) too. The backtrace indicates the error starts
at .put().

0   x 0x253b
D3std5array18__T8AppenderTAfTfZ8Appender12readCapacityMFZk + 63
1   x 0x26a9
D3std5array18__T8AppenderTAfTfZ8Appender8capacityMFZk + 81
2   x 0x6372
D3std5array18__T8AppenderTAfTfZ8Appender10__T3putTfZ3putMFfZv + 118
3   x 0x2330 _Dmain + 424
4   x 0x000118d7
D2rt6dmain24mainUiPPaZi7runMainMFZv + 23
5   x 0x0001180e
D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 42
6   x 0x0001191f
D2rt6dmain24mainUiPPaZi6runAllMFZv + 59
7   x 0x0001180e
D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv + 42
8   x 0x0001179b main + 179
9   x 0x217d start + 53

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


[Issue 4681] Strange access violation Mandelbug with AAs + Appender

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4681



--- Comment #3 from kenn...@gmail.com 2010-08-19 11:29:49 PDT ---
A much shorter test case:

import std.random, std.array;

void main() {
Appender!(int[])[3] aa;
foreach(i; 0..1)
aa[uniform(0, aa.length)].put(i);
}

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


[Issue 4681] Strange access violation Mandelbug with AAs + Appender

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4681



--- Comment #4 from David Simcha dsim...@yahoo.com 2010-08-19 11:35:11 PDT ---
It's definitely a bug in Appender, not a bug in the runtime or AAs.  Replacing
2.048 Appender with 2.047 Appender in array.d and recompiling Phobos and my
code makes this bug go away.  

All the cruft about associative arrays and stuff is just artifacts of how I
initially discovered this bug and the test case I was reducing from.

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


[Issue 4681] Strange access violation Mandelbug with AAs + Appender

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4681



--- Comment #5 from kenn...@gmail.com 2010-08-19 11:46:51 PDT ---
Deterministic test case (always crash on my machine):



import std.array,std.stdio;

void main() {
Appender!(uint[])[3] aa;

auto x = [
   
0,1,1,0,2,1,2,2,1,2,0,0,2,1,1,1,2,0,0,0,0,0,0,2,1,2,1,0,1,2,0,0,0,2,0,1,
   
1,0,1,0,2,2,0,0,1,2,0,1,1,1,1,2,0,0,2,1,1,2,2,0,0,2,1,0,1,0,2,0,0,0,0,2,
   
2,2,1,1,0,0,2,2,0,0,2,1,2,1,0,1,0,1,2,1,1,2,1,1,0,1,2,2,1,0,1,0,0,0,2,1,
   
1,1,0,2,0,2,0,1,2,0,2,0,1,0,0,0,0,1,1,0,2,2,0,2,1,0,0,0,0,1,1,0,0,1,1,0,
   
2,2,0,2,2,2,2,0,1,1,1,2,0,0,0,2,1,2,0,2,0,1,0,2,1,0,2,1,2,0,0,1,2,1,1,2,
   
2,2,1,2,2,1,1,0,1,2,0,1,0,2,0,0,1,0,0,0,2,1,1,0,1,0,1,1,2,2,0,2,0,1,0,1,
   
2,1,1,1,0,0,0,0,1,0,2,2,2,2,2,1,0,0,0,0,0,1,0,2,1,0,2,2,1,0,2,2,0,0,1,1,
   
1,1,1,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,1,1,1,2,1,1,2,1,1,0,1,0,2,0,2,2,2,0,1,1,0,
   
0,0,1,2,2,1,2,0,0,0,2,1,1,0,0,2,0,2,1,0,1,2,2,1,0,1,1,0,1,1,2,2,1,0,2,0,
   
1,2,0,0,1,2,2,2,1,1,1,2,0,2,2,0,0,0,0,0,0,2,2,2,1,2,1,0,2,0,2,1,0,0,1,0,
   
0,0,1,1,0,0,2,2,2,0,0,2,0,1,0,2,2,0,1,1,1,1,0,2,0,0,0,1,1,1,1,1,2,2,0,2,
   
2,0,1,0,2,1,0,0,1,0,0,1,1,1,0,0,0,0,2,0,1,0,1,1,0,2,2,0,0,2,0,2,1,0,1,2,
   
0,2,1,1,2,0,1,0,0,0,2,0,0,1,0,0,0,2,0,0,2,2,1,2,0,0,1,2,1,2,2,1,1,0,2,1,
   
2,2,2,1,1,1,0,2,2,2,1,2,2,2,2,0,0,2,1,0,0,1,2,1,2,1,1,2,2,1,2,1,2,0,2,1,
   
1,2,1,0,0,2,2,2,0,0,0,2,2,2,1,0,1,2,1,1,2,1,2,0,0,1,0,0,0,1,2,1,1,0,1,1,
0,1,1
];

foreach(v; x)
aa[v].put(0);
}

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


[Issue 4536] Typetuples (T...) should have an .init member

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4536



--- Comment #1 from Philippe Sigaud philippe.sig...@gmail.com 2010-08-19 
22:35:10 CEST ---
(In reply to comment #0)

 template Init(T...)
 {
 alias (Tuple!T.init).expand Init;
 }

Hmm, my mistake, the previous version doesn't work. I'm pretty sure it used to,
since I was using it in my code.

Anyway, here is a far more simple version, no dependency:

template Init(T...)
{
T Init;
}

a initialized T is correctly created. I still think .init should work like this
for typetuples.

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


[Issue 4682] New: Run-time Vs Compile-time of int.min % -1

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4682

   Summary: Run-time Vs Compile-time of int.min % -1
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-08-19 14:34:54 PDT ---
With dmd 2.048 this program gives (on Windows) a runtime error:

int foo(int x, int y) {
return x % y;
}
void main() {
int r = foo(int.min, -1);
}



But the same operation done at compile time gives no errors, and foo returns 0:

int foo(int x, int y) {
return x % y;
}
static assert(foo(int.min, -1) == 0);
void main() {}


So one of the two cases is wrong (or both).

While floating point operations done at compile-time may give slightly
different results, I'd like integral operations to give the same results at
compile-time and run-time.

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


[Issue 4679] Problem with final override

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4679


Jonathan M Davis jmdavisp...@gmail.com changed:

   What|Removed |Added

 CC||jmdavisp...@gmail.com


--- Comment #1 from Jonathan M Davis jmdavisp...@gmail.com 2010-08-19 
15:39:49 PDT ---
The fact that private has anything to do with final is arguably a bug. It
certainly contradicts TDPL. The bug on that is
http://d.puremagic.com/issues/show_bug.cgi?id=4542

Now, this is still a bug. Either dmd still makes private final, at which point
overriding the method should be a bug, or it follows TDPL and does not make it
final, at which point, the derived method should be called, which it isn't. So,
this is a definitely a bug, but I'd favor fixing #4542 and make it call the
derived method rather than making overriding the method an error.

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


[Issue 4535] std.range could have a takeWhile!pred(range) function

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4535



--- Comment #3 from Philippe Sigaud philippe.sig...@gmail.com 2010-08-20 
00:46:32 CEST ---
(In reply to comment #1)
 Doesn't std.algorithm.until pretty much do what you want?

Hmm.
I see until() is templated on the predicate. I guess most of the time, I can
rewrite my predicates to use until.

auto t = takeWhile!a*a10(someValues);
auto u = until!a*ab(10, someValues); // hey, b is 10, a will be elements
from someValues. Is that clear?

I personally find takeWhile to be more readable. Maybe I'm biased due to my
using it in other languages?


Also, it's cumbersome for no-arg functions:

// takes lines as long as they are not empty
auto t = takeWhile!!a.empty(file.byLine);
auto u = until!!a.empty(dummy, file.byLine);

auto t = takeWile!externalUnaryPredicate(someValues);
auto u = until!externalUnaryPredicate(??, someValues); // How do I do that?


Philippe

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


[Issue 4683] New: [patch] rdmd: -od clobbers preceeding -of

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4683

   Summary: [patch] rdmd: -od clobbers preceeding -of
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
16:40:02 PDT ---
Created an attachment (id=727)
Patch against rdmd r1400

Assuming a program main.d, and directories bin/ and obj/:

 dmd -ofbin\myapp -odobj\ main.d
[Creates bin\myapp.exe]

 rdmd -ofbin\myapp -odobj\ main.d
[Creates obj\main.exe]

The result is an executable with the wrong name in the wrong directory.

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


[Issue 4603] array(iota(1, 0)) error

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4603


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 CC||dsim...@yahoo.com


--- Comment #4 from David Simcha dsim...@yahoo.com 2010-08-19 17:07:09 PDT ---
Fixed in changeset 1901.  I chose to throw in this case.  The proper way to
create an empty range would be to do iota(0, 0), or iota(1, 1).  The main
reason for this choice was consistency with array slicing.  For example, if
bounds checking is enabled, array[3..2] throws a RangeError.

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


[Issue 4684] New: [patch] rdmd: Assert failure on -od without trailing slash

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4684

   Summary: [patch] rdmd: Assert failure on -od without trailing
slash
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
17:18:43 PDT ---
Created an attachment (id=728)
Patch against rdmd r1400

 dmd -odobj hello.d
[Ok]

 rdmd -odobj hello.d
core.exception.asserter...@rdmdorig(51): Assertion failure

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


[Issue 4684] [patch] rdmd: Assert failure on -od without trailing slash

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4684



--- Comment #1 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
17:26:44 PDT ---
Created an attachment (id=729)
Unified patch against rdmd r1400 for #4672, #4683 and #4684

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


[Issue 4672] [patch] rdmd fails when -I is needed

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4672



--- Comment #3 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
17:28:54 PDT ---
Over here is a unified patch against rdmd r1400 for #4672, #4683 and #4684:

http://d.puremagic.com/issues/show_bug.cgi?id=4684

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


[Issue 4683] [patch] rdmd: -od clobbers preceeding -of

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4683



--- Comment #1 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
17:28:28 PDT ---
Over here is a unified patch against rdmd r1400 for #4672, #4683 and #4684:

http://d.puremagic.com/issues/show_bug.cgi?id=4684

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


[Issue 4684] [patch] rdmd: Assert failure on -od without trailing slash

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4684


Nick Sabalausky cbkbbej...@mailinator.com changed:

   What|Removed |Added

 Attachment #728 is|0   |1
   obsolete||


--- Comment #2 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
17:38:32 PDT ---
Created an attachment (id=730)
Patch against rdmd r1400

Forgot to mark this as a patch

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


[Issue 4685] New: in contract of base class affected by the body of the overriding function

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4685

   Summary: in contract of base class affected by the body of the
overriding function
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic andrej.mitrov...@gmail.com 2010-08-19 
17:39:30 PDT ---
This code is normal:

import std.conv;

class BasicDate
{
string format(string spec)
in
{
writeln(in basicdate.format contract);
writeln(spec);
assert(spec == 1234);
}
body
{
return ;
}
}

class Date : BasicDate
{
override string format(string spec)
in  
{
writeln(in date.format contract);
writeln(spec);
assert(spec == 1234);
}
body
{
//~ string x;
return ;
}
}

import std.stdio;

unittest
{
auto mydate = new Date;
mydate.format(1234);
}

void main()
{
}

Prints:
in basicdate.format contract
1234

Now I uncomment the string x line in the overriding function:

import std.conv;

class BasicDate
{
string format(string spec)
in
{
writeln(in basicdate.format contract);
writeln(spec);
assert(spec == 1234);
}
body
{
return ;
}
}

class Date : BasicDate
{
override string format(string spec)
in  
{
writeln(in date.format contract);
writeln(spec);
assert(spec == 1234);
}
body
{
string x;
return ;
}
}

import std.stdio;

unittest
{
auto mydate = new Date;
mydate.format(1234);
}

void main()
{
}

Prints:
in basicdate.format contract
(null)
in date.format contract
1234

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


[Issue 4603] array(iota(1, 0)) error

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4603



--- Comment #5 from bearophile_h...@eml.cc 2010-08-19 17:44:23 PDT ---
Throwing? No, look at Python:

 range(1, 0)
[]

It needs to return an empty range.

This:
foreach (i; iota(1, 0))
is the same as:
foreach (i; 1 .. 0)
Or:
for (int i = 1; i  0; i++)

It's like an empty loop.

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


[Issue 4686] New: rdmd could use an incremental compilation option

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4686

   Summary: rdmd could use an incremental compilation option
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
17:46:03 PDT ---
rdmd should have the ability (probably through a flag like --incremental) to
keep the generated object files and only recompile the modules that have been
changed (or are dependent on a module that has been changed).

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


[Issue 4603] array(iota(1, 0)) error

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4603



--- Comment #6 from bearophile_h...@eml.cc 2010-08-19 17:49:22 PDT ---
And by the way, in Python This produces an empty string slice:

 abcdefg[3:2]
''

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


[Issue 4683] [patch] rdmd: -od clobbers preceeding -of

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4683



--- Comment #2 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
17:47:22 PDT ---
This would be especially needed if #4686: rdmd could use an incremental
compilation option ( http://d.puremagic.com/issues/show_bug.cgi?id=4686 ) is
implemented.

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


[Issue 4603] array(iota(1, 0)) error

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4603


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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


[Issue 3868] It would be nice to have a function which read a file lazily using a range

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3868


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 CC||dsim...@yahoo.com


--- Comment #1 from David Simcha dsim...@yahoo.com 2010-08-19 19:14:53 PDT ---
Shouldn't std.stdio.File.byChunk() do this?

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


[Issue 4687] New: Strange error on simple main with response file from xfbuild

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4687

   Summary: Strange error on simple main with response file from
xfbuild
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
19:43:24 PDT ---
Created an attachment (id=731)
Response file from xfbuild that results in an error on dmd

I can't tell if this is a problem with DMD or with the response file generated
from xfbuild ( http://bitbucket.org/h3r3tic/xfbuild/wiki ), so I'm filing
tickets in both places.

With the file 'testConv.d':
---
module testConv;
import std.conv;
void main()
{
int x = to!int(7);
}
---

Doing dmd testConv.d works fine. Doing xfbuild testConv.d generates the
attached DMD response file xfbuild.b10e00.rsp (add the +keeprsp param to
prevent xfbuild from automatically deleting the response file). Then, doing
dmd @xfbuild.b10e00.rsp results in an error:

D:\DevTool\dmd\bin\..\src\phobos\std\algorithm.d(2890): Error:
cast(string)_param_1 is not an lvalue

Note that the paths to phobos, in both that response file and the error
message, *are* the correct paths to phobos on my system (yes, I do move
dmd\windows\* to dmd\*, but I'm fairly certain that's not the problem here.
If it were, I'd most likely be experiencing this problem elsewhere, but I'm
not. For instance, rdmd works fine).

I'm using DMD 2.048.

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


[Issue 4687] Strange error on simple main with response file from xfbuild

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4687



--- Comment #1 from Nick Sabalausky cbkbbej...@mailinator.com 2010-08-19 
20:01:20 PDT ---
ticket over on xfbuild:
http://bitbucket.org/h3r3tic/xfbuild/issue/20/strange-error-on-simple-main-when-using

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


[Issue 3868] It would be nice to have a function which read a file lazily using a range

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3868


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

   What|Removed |Added

 CC||and...@metalanguage.com


--- Comment #2 from Andrei Alexandrescu and...@metalanguage.com 2010-08-19 
21:08:24 PDT ---
byChunk uses opApply. We need to transform it into a range; using opApply alone
severely limits the applicability of byChunk.

Here's a nice potential application of byChunk:

import std.stdio;
void main(string[] a) {
enforce(a.length == 3);
auto f1 = File(a[1]), f2 = File(a[2]);
immutable bufsize = 1024 * 1024;
return equal(f1.byChunk(bufsize), f2.byChunk(bufsize));
}

One other idea suggested by the above is to implement the algorithm found in
diff in std.algorithm. Then we can write a diff program in a dozen line of
code, using general components.

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


[Issue 4684] [patch] rdmd: Assert failure on -od without trailing slash

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4684


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

   What|Removed |Added

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


--- Comment #3 from Andrei Alexandrescu and...@metalanguage.com 2010-08-19 
21:10:10 PDT ---
Thanks, Nick!

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


[Issue 4355] random + take = fail

2010-08-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4355


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dsim...@yahoo.com
 Resolution||FIXED


--- Comment #1 from David Simcha dsim...@yahoo.com 2010-08-19 21:52:14 PDT ---
Fixed 2.048

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