[Issue 3653] Problem sorting array of Rebindable

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3653


Shin Fujishiro rsi...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #2 from Shin Fujishiro rsi...@gmail.com 2010-05-26 02:57:50 PDT 
---
Fixed in svn r1554. Thanks for the patch! (or hack ;-))

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


[Issue 3786] bug in std.string.removechars

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3786


Shin Fujishiro rsi...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #4 from Shin Fujishiro rsi...@gmail.com 2010-05-26 02:59:52 PDT 
---
Fixed in svn r1555. Thanks for the correct code!

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


[Issue 4188] std.file.remove throws Exception on success

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4188


Shin Fujishiro rsi...@gmail.com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||rsi...@gmail.com
 AssignedTo|nob...@puremagic.com|rsi...@gmail.com


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


[Issue 1001] print stack trace (in debug mode) when program die

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1001


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #22 from bearophile_h...@eml.cc 2010-05-26 04:25:20 PDT ---
This is an example of Python program that gives a stack trace (here I have used
a lambda also to show that stack trace printing code sometimes has problems
with anonymous functions):

reverser = lambda s: s[-1] + reverser(s[:-1]) if s else 
print reverser(this is a test * 200)

After battling with huge stack traces in Python, there's another feature that
I'd like to have in D (I am not sure if on default or not): stack trace
compression. If a recursive function keeps calling itself, or two functions
keep calling each other (other possibilities exist, but those two cover most
cases), the stack trace can become too much long to print and read.

So just looking at the latest stack frame printed and penultimate stack frame
printed it can compress it, reporting only how many time the last one or the
last two ones are repeated (the uncompressed stack trace can be obtained too
(on request if the compressed one is on default, otherwise it's the compressed
one that's on request), that shows all the line numbers too).

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


[Issue 1001] print stack trace (in debug mode) when program die

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1001


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

   What|Removed |Added

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


--- Comment #23 from Don clugd...@yahoo.com.au 2010-05-26 05:41:33 PDT ---
(In reply to comment #22)

 If a recursive function keeps calling itself, or two functions
 keep calling each other (other possibilities exist, but those two cover most
 cases), the stack trace can become too much long to print and read.
 
 So just looking at the latest stack frame printed and penultimate stack frame
 printed it can compress it, reporting only how many time the last one or the
 last two ones are repeated (the uncompressed stack trace can be obtained too
 (on request if the compressed one is on default, otherwise it's the compressed
 one that's on request), that shows all the line numbers too).

That's what's done with the template instantiation backtraces in the compiler,
and I think it works very well. The basic idea is to always print out the first
few frames, and only start looking for recursion beginning at frame 3 or 4.
I intend to add something similar to the interpreter, so that we have a CTFE
stack trace. Still needs work though.

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


[Issue 4188] std.file.remove throws Exception on success

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4188


Shin Fujishiro rsi...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #1 from Shin Fujishiro rsi...@gmail.com 2010-05-26 07:23:37 PDT 
---
Fixed in svn r1560.

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


[Issue 4179] Deleting items from an associative array iterated over

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4179



--- Comment #2 from bearophile_h...@eml.cc 2010-05-26 09:49:51 PDT ---
To implement this idea the foreach() has to change a little, in nonrelease mode
it has to set and later reset a boolean flag inside the container being
iterated. So this boolean value if present must have a standard name, that has
to be shown in the std.container page about the standard API of the container.
If implemented this idea lessens a little the need for the stable (soft)
methods.

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


[Issue 4235] New: !in not working (D1)

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4235

   Summary: !in not working (D1)
   Product: D
   Version: unspecified
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dbu...@yahoo.com


--- Comment #0 from Random Name dbu...@yahoo.com 2010-05-26 11:18:44 PDT ---
According to the D1 spec !in should be a valid syntax, however the compiler
outputs a syntax error when used. With a large enough code base the compiler
crashes.

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


[Issue 4235] !in not working (D1)

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4235


Masahiro Nakagawa repeate...@gmail.com changed:

   What|Removed |Added

 CC||repeate...@gmail.com


--- Comment #1 from Masahiro Nakagawa repeate...@gmail.com 2010-05-26 
12:19:09 PDT ---
I think D1 spec is incorrect. !in isn't listed at D1 changelog.

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


[Issue 4236] New: 'out of memory' error compiling on windows

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4236

   Summary: 'out of memory' error compiling on windows
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bugzi...@digitalmars.com


--- Comment #0 from Walter Bright bugzi...@digitalmars.com 2010-05-26 
12:31:11 PDT ---
Reported by le_...@gmx.net:

i got an 'out of memory' error when compiling lage(r) d files
using dmd v1.061 on windows.
on freebsd/linux the same dmd version compiles the d source without problems.

interesting is that i get the same error when compiling a similar c source
code using the digital mars c compiler.

anyone knows which wall i'm hitting in the dmd/dmc compiler backend ?

the source files in question are generated using the following d program
(mkdata.d) from binary blobs (e.g. zip files) :

howto reproduce :
dmd mkdata
mkdata foo.zip  data.d
dmd -c data.d

for dmc:
mkdata -cxx foo.zip  data.c
dmc -c data.c

the problem starts when foo.zip is larger than 800kb giving a 4+ mb data.d

-- mkdata.d --
import std.stdio;
import std.string;
import std.file;
import std.path;

static void gen_d(string name,string data)
{
writefln(const string name_ ~ name ~ =\ ~ name ~ \;);
writef(const ubyte[] data_ ~ name ~  = [);
foreach(n,d;data)
writef(0x%02x,,d);
writefln(\n]; // end of data_ ~ name);
}

static void gen_cxx(string name,string data)
{
writefln(#ifndef  ~ std.string.toupper(name) ~ _h);
writefln(#define  ~ std.string.toupper(name) ~ _h);

writefln(static const char* name_ ~ name ~ =\ ~ name ~ \;);
writefln(static unsigned int size_ ~ name ~ =%d;,data.length);
writef(static const char data_ ~ name ~ [] = {);

foreach(n,d;data)
{
if( (n % 16) == 0)
writef(\n// %d : 0x%04x\n,n/16,n);
writef(0x%02x,,d);
}
writefln(\n}; // end of data_ ~ name);
writefln(\n#endif //  ~ std.string.toupper(name) ~ _h);
}

int main(string[] args)
{
bool do_cxx=false;
uint n=0;
foreach(arg;args[1 .. $])
{
if(arg == -cxx)
{
do_cxx=true;
continue;
}

if(n == 0  !do_cxx) writefln(module ddata;\n);

string name=arg;
name=replace(name,-,_);
name=replace(name,.,_);

try
{
char[] data=cast(char[]) std.file.read(arg);
n++;
string tag=format(%s%d,name,n);

do_cxx ? gen_cxx(name,data) : gen_d(name,data);
}
catch(FileException ex)
{
writefln(arg ~  : got FileEx:  ~ ex.msg);
continue ; //next;
}
}

return 0;
}

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


[Issue 4237] New: Link error with typedefs of the same name in a function scope

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4237

   Summary: Link error with typedefs of the same name in a
function scope
   Product: D
   Version: 2.041
  Platform: x86
OS/Version: All
Status: NEW
  Keywords: link-failure
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: rsi...@gmail.com


--- Comment #0 from Shin Fujishiro rsi...@gmail.com 2010-05-26 12:35:19 PDT 
---
Typedefs in function scope don't get fully mangled with scope information.  As
a result, the following code won't link:
 test.d
struct Struct(T)
{
T value;
}
void main()
{
{
typedef int Number = 1;
Struct!Number s;
pragma(msg, 1: , typeof(s).mangleof);
}
{
typedef real Number = 2;
Struct!Number s;
pragma(msg, 2: , typeof(s).mangleof);
}
}


On Linux and FreeBSD:

1: S4test20__T6StructTT6NumberZ6Struct
2: S4test20__T6StructTT6NumberZ6Struct
test.o(.rodata+0x18): multiple definition of `_Dmain6Number6__initZ'
test.o(.rodata+0x14): first defined here


On Windows:

1: S4test20__T6StructTT6NumberZ6Struct
2: S4test20__T6StructTT6NumberZ6Struct
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 0027DH Record Type 0091 
 Error 1: Previous Definition Different : _Dmain6Number6__initZ
--- errorlevel 1


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


[Issue 4169] building dmd with a modern gcc produces a buggy compiler

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4169


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2010-05-26 
12:47:48 PDT ---
http://www.dsource.org/projects/dmd/changeset/502

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


[Issue 4238] New: Segfault(statement.c): with(typeof(int))

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4238

   Summary: Segfault(statement.c): with(typeof(int))
   Product: D
   Version: 1.020
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: ice-on-invalid-code, patch
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: clugd...@yahoo.com.au


--- Comment #0 from Don clugd...@yahoo.com.au 2010-05-26 13:03:03 PDT ---
TEST CASE:
-
void bug4237()
{
   int s;
   with(typeof(s)) {}
}


PATCH (D2 svn 502):
// WithStatement::semantic. line 3639: segfaults because toDsymbol(sc)
// returns null.

{   TypeExp *es = (TypeExp *)exp;

-sym = es-type-toDsymbol(sc)-isScopeDsymbol();
+Dsymbol *dsym = es-type-toDsymbol(sc);
+sym = dsym ? dsym-isScopeDsymbol() : NULL;

if (!sym)
{   error(%s has no members, es-toChars());
body = body-semantic(sc);
return this;
}
}

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


[Issue 4238] Segfault(statement.c): with(typeof(int))

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4238



--- Comment #1 from Don clugd...@yahoo.com.au 2010-05-26 13:20:16 PDT ---
Darn it, waited to long before hitting submit, and another bug snuck in before
this one -- test case should be changed to bug4238(). g.

Anyway, if you add one line to the patch, it fixes bug 1413. I was actually
trying to generate a case where 1413 matters, but failed. But I found this case
instead.

PATCH (D2 svn 502):
// WithStatement::semantic. line 3639: segfaults because toDsymbol(sc)
// returns null.

{   TypeExp *es = (TypeExp *)exp;

-sym = es-type-toDsymbol(sc)-isScopeDsymbol();
+Dsymbol *dsym = es-type-toDsymbol(sc);
+sym = dsym ? dsym-isScopeDsymbol() : NULL;

if (!sym)
{   error(%s has no members, es-toChars());
+   if (body)
body = body-semantic(sc);
return this;
}
}

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


[Issue 1413] not every body is guarded by if statement in DMDFE

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1413


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

   What|Removed |Added

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


--- Comment #1 from Don clugd...@yahoo.com.au 2010-05-26 13:21:06 PDT ---
The code is in WithStatement::semantic().

Bug 4238 deals with the same piece of code; I've included this in the patch for
it.

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


[Issue 4239] New: Mixed tuple comparison

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4239

   Summary: Mixed tuple comparison
   Product: D
   Version: future
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: simen.kja...@gmail.com


--- Comment #0 from Simen Kjaeraas simen.kja...@gmail.com 2010-05-26 14:49:58 
PDT ---
I have been unable to find a way to compare two tuples of mixed content, like
(int, foo). For this purpose, I have created the following template, and
request its inclusion in Phobos.

/**
Compares tuples with a mixture of types and values.

Example:

static assert(SameTuple!(int, int).As!(int, int));
static assert(SameTuple!(int, foo).As!(int, foo));
static assert(!SameTuple!(int, foo).As!(foo, int));

 */

template SameTuple(T...) {
alias SameTupleImpl!T SameTuple;
}

template SameTupleImpl(T...) if (T.length == 1) {
template As(U...) if (U.length == 1) {
static if (is(typeof( T[0]))  is(typeof(U[0]))) {
enum As = T[0] == U[0];
} else static if (!is(typeof( T))  !is(typeof(U[0]))) {
enum As = is(T[0] == U[0]);
} else {
enum As = false;
}
}
template As(U...) if (U.length != 1) {
enum As = false;
}
}

template SameTupleImpl(T...) if (T.length != 1) {
template As(U...) {
static if (T.length != U.length) {
enum As = false;
} else static if (T.length == 0) {
enum As = true;
} else {
enum As = SameTuple!(T[0]).As!(U[0]) 
SameTuple!(T[1..$]).As!(U[1..$]);
}
}
}

unittest {
static assert(SameTuple!(int, int).As!(int, int));
static assert(SameTuple!(float).As!(float));
static assert(SameTuple!(foo).As!(foo));
static assert(!SameTuple!(foo).As!(bar));
static assert(!SameTuple!(int ).As!(bar));
static assert(!SameTuple!(int ).As!(float));
static assert(SameTuple!(int, foo).As!(int, foo));
static assert(!SameTuple!(int, foo).As!(foo, int));
static assert(SameTuple!().As!());
static assert(!SameTuple!(int).As!());
static assert(!SameTuple!().As!(int));
static assert(!SameTuple!(foo).As!());
static assert(!SameTuple!().As!(foo));
}

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


[Issue 4239] Mixed tuple comparison

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4239


nfx...@gmail.com changed:

   What|Removed |Added

 CC||nfx...@gmail.com


--- Comment #1 from nfx...@gmail.com 2010-05-26 14:58:55 PDT ---
This seems to work fine:

struct X(T...) { }

static assert(is(X!(int, int) == X!(int, int)));
static assert(is(X!(int, foo) == X!(int, foo)));
static assert(!is(X!(int, foo) == X!(foo, int)));

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


[Issue 4133] Enable __traits on D1

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4133


Trass3r mrmoc...@gmx.de changed:

   What|Removed |Added

 CC||mrmoc...@gmx.de


--- Comment #4 from Trass3r mrmoc...@gmx.de 2010-05-26 15:13:13 PDT ---
 you have to use char[][] b = [__traits(allMembers, D) ];

allMembers returns a tuple now which is a lot better for compile-time
iterations.

-- 
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-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=314


Trass3r mrmoc...@gmx.de changed:

   What|Removed |Added

 CC||mrmoc...@gmx.de


--- Comment #14 from Trass3r mrmoc...@gmx.de 2010-05-26 15:10:04 PDT ---
when will this be fixed?

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


[Issue 4239] Mixed tuple comparison

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4239



--- Comment #2 from Simen Kjaeraas simen.kja...@gmail.com 2010-05-26 15:20:55 
PDT ---
(In reply to comment #1)
 This seems to work fine:
 
 struct X(T...) { }
 
 static assert(is(X!(int, int) == X!(int, int)));
 static assert(is(X!(int, foo) == X!(int, foo)));
 static assert(!is(X!(int, foo) == X!(foo, int)));

Indeed it does. I do however still feel it should be included in Phobos as
something more obvious.
Simplified version, with newly acquired knowledge:

/**
Compares tuples that might contain a mixture of types and values.

Example:

static assert(SameTuple!(int, int).As!(int, int));
static assert(SameTuple!(int, foo).As!(int, foo));
static assert(!SameTuple!(int, foo).As!(foo, int));

 */

struct SameTupleImpl(T...) {
}

template SameTuple(T...) {
template As(U...) {
enum As = is( SameTupleImpl!T == SameTupleImpl!U );
}
}

unittest {
static assert(SameTuple!(int, int).As!(int, int));
static assert(SameTuple!(float).As!(float));
static assert(SameTuple!(foo).As!(foo));
static assert(!SameTuple!(foo).As!(bar));
static assert(!SameTuple!(int ).As!(bar));
static assert(!SameTuple!(int ).As!(float));
static assert(SameTuple!(int, foo).As!(int, foo));
static assert(!SameTuple!(int, foo).As!(foo, int));
static assert(SameTuple!().As!());
static assert(!SameTuple!(int).As!());
static assert(!SameTuple!().As!(int));
static assert(!SameTuple!(foo).As!());
static assert(!SameTuple!().As!(foo));
}

-- 
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-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=314



--- Comment #15 from Leandro Lucarella llu...@gmail.com 2010-05-26 15:19:42 
PDT ---
In D4, maybe =P

Don't be impatient, is just number 1 in votes!

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


[Issue 4133] Enable __traits on D1

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4133



--- Comment #5 from nfx...@gmail.com 2010-05-26 15:37:29 PDT ---
I was just saying you have to use char[][] b = [...] instead of auto b =
[...]. This is the only point where you have to modify the examples in the
traits documentation to make it work on D1+this patch. That change doesn't have
to do anything with __traits or this patch. It's just that auto b = [a,
bc]; simply doesn't compile in D1.

-- 
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-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=314



--- Comment #16 from Trass3r mrmoc...@gmx.de 2010-05-26 15:42:36 PDT ---
Well that's the point.
- 32 votes!
- present since v0.165!
- patch is available that seems to work for ldc

-- 
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-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=314



--- Comment #17 from Leandro Lucarella llu...@gmail.com 2010-05-26 19:01:01 
PDT ---
I was being sarcastic =)

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