[Issue 4071] Missing support to share memory and objects between DLLs and executable

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4071


d...@dawgfoto.de changed:

   What|Removed |Added

 CC||d...@dawgfoto.de


--- Comment #11 from d...@dawgfoto.de 2012-01-17 23:56:24 PST ---
I have recently done a ModuleInfo refactoring along this line.

I'd like to avoid having to link in a static library.
The planned ELF mechanism works like the following:

 - The compiler emits a static init function into each
   object, library or executable. This function is a
   comdat so every DLL or EXE will have a single init
   function.

 - _minfo_beg/_minfo_end and _deh_beg/_deh_end are made
static symbols.

 - The init function registers it's modules/EH tables
   with a global function in druntime. There we create
   an entry and store additional data like TLS index
   and writeable segments for GC.

 - The module initialization must now only iterate over
   all dlls and initialize them in the order of registration.

If we can figure out how to create a static init function
the same mechanism should work for Windows.
By splitting registration and initialization we should
be able to perform module construction outside DllMain of.

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


[Issue 7309] [2.058] Regression caused by new inlining code

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7309


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
02:19:40 PST ---
https://github.com/D-Programming-Language/dmd/commit/21c62d6b8501fd135d64de70b7e42431ca898d12

https://github.com/D-Programming-Language/dmd/commit/41f80b65500e2c979ddc180ca7645be985e77bb2

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #16 from bearophile_h...@eml.cc 2012-01-18 04:40:14 PST ---
(In reply to comment #13)
 There are two very different use cases in D here.

An option is to add another kind of switch attribute:

enum switch (foo) {
case c1: break; // all c1,c2 must be a compile-time constants
case c2: break;
default: break;
}

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #17 from Stewart Gordon s...@iname.com 2012-01-18 06:45:23 PST ---
(In reply to comment #16)
 (In reply to comment #13)
  There are two very different use cases in D here.
 
 An option is to add another kind of switch attribute:
 
 enum switch (foo) {
 case c1: break; // all c1,c2 must be a compile-time constants
 case c2: break;
 default: break;
 }

We already have an enum switch - it's called final switch.  Inventing something
new and calling it enum switch will be confusing.  What would it be anyway -
just an optional check for the programmer similar to the override attribute?

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


[Issue 6178] Struct inside the AA are not init correctly

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6178


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

   What|Removed |Added

 CC||and...@metalanguage.com


--- Comment #5 from Andrei Alexandrescu and...@metalanguage.com 2012-01-18 
08:40:19 PST ---
Update - with the dmd from the head the example causes 

Internal error: backend/cgcs.c 162

If the destructor is commented out, the printed message on my machine is

-2084965984 opAssign called

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


[Issue 107] Wrong filename in error message when using a mixin

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=107



--- Comment #10 from Leandro Lucarella leandro.lucare...@sociomantic.com 
2012-01-18 09:32:34 PST ---
Works now on DMD 1.071. If it work with the current version too tests should be
added to the test suit and the bug can be closed.

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


[Issue 107] Wrong filename in error message when using a mixin

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=107



--- Comment #11 from Leandro Lucarella leandro.lucare...@sociomantic.com 
2012-01-18 09:33:52 PST ---
(In reply to comment #10)
 Works now on DMD 1.071. If it work with the current version too tests should 
 be
 added to the test suit and the bug can be closed.

BTW, this is the error message I get, line numbers and files look good:

mixin_21_A.d(12): Error: undefined identifier UNDEFINED
mixin_21_B.d(15): Error: mixin mixin_21_B.T!() error instantiating

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #18 from bearophile_h...@eml.cc 2012-01-18 09:53:06 PST ---
(In reply to comment #17)

 We already have an enum switch - it's called final switch.

The purpose of this idea is different. A final switch requires to list all
possibilities and it forbids the default case.


 Inventing something new and calling it enum switch will be confusing.

I see.


 What would it be anyway - just an optional check for the programmer
 similar to the override attribute?

override will stop being optional, see issue 3836. Likewise this was not meant
to be optional, eventually.

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #19 from Jonathan M Davis jmdavisp...@gmx.com 2012-01-18 10:01:02 
PST ---
Personally, I think that simplest and best solution is to just restrict case
statements to compile-time constants like every language does. I agree with Don
that this feature is a misfeature. We already have if-else-if chains for the
general case.

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #20 from bearophile_h...@eml.cc 2012-01-18 10:06:02 PST ---
(In reply to comment #19)
 Personally, I think that simplest and best solution is to just restrict case
 statements to compile-time constants like every language does.

I agree :-)

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176


Andrej Mitrovic andrej.mitrov...@gmail.com changed:

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com


--- Comment #21 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-01-18 
10:16:13 PST ---
Switch allows more funky code:

import std.stdio;
string a() { return a; }
void main()
{
switch (a) {
case a():
writeln(true);
default:
}
}

and:

import std.stdio;
int foo() { return 1; }
void main()
{
int x;
switch (x = foo())
{
default:
}
}

`if (x = foo())` can't work, so I don't know why `switch (x = foo())` can.

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


[Issue 7310] New: pure function results should implicitly cast to mutable

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310

   Summary: pure function results should implicitly cast to
mutable
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 10:51:02 PST ---
The following code should compile
immutable(int)[] foo()pure{return new int[1];}
void main(){int[] x = foo();}

as should this (alternatively it should error out on the first line, not on the
second):
const(int)[] foo()pure{return new int[1];}
void main(){int[] x = foo();}

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


[Issue 7311] New: typeof(x~y) should never be const(T)[]

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7311

   Summary: typeof(x~y) should never be const(T)[]
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 10:56:30 PST ---
typeof(x~y) should never be const(T)[].
const only has a meaning in presence of aliasing. Unique const data is
meaningless.

int[] a;
immutable int[] b;
const int[] c;
static assert(typeof(a~b)==int[]);
static assert(typeof(a~c)==int[]);
static assert(typeof(b~b)==immutable(int)[]);
static assert(typeof(b~c)==immutable(int)[]);
static assert(typeof(c~c)==int[]);

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


[Issue 7312] New: const should be abstract

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7312

   Summary: const should be abstract
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 11:03:10 PST ---
const only has a meaning in presence of aliasing. Unique const data is
meaningless. const is abstract. strongly pure functions should not be allowed
to return const; they can return mutable or immutable data instead.

static assert(!is(typeof(new const(Object;
static assert(!is(typeof(new const(int)[1])));
static assert(!is(typeof({const(Object) foo(){return new Object;}})));
static assert(!is(typeof({const(int)[] foo(){return new int[1];}})));

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


[Issue 150] std.gc.minimize doesn't minimize physical memory usage

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=150


d...@dawgfoto.de changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||d...@dawgfoto.de
 Resolution||FIXED


--- Comment #4 from d...@dawgfoto.de 2012-01-18 11:08:21 PST ---
import core.memory;
import std.stdio;

struct GCStats
{
size_t poolsize;// total size of pool
size_t usedsize;// bytes allocated
size_t freeblocks;  // number of blocks marked FREE
size_t freelistsize;// total of memory on free lists
size_t pageblocks;  // number of blocks marked PAGE
}

extern(C) GCStats gc_stats();

void printGC(){
auto stat = gc_stats();

writefln(poolsize: %s; usedsize: %s; freeblocks: %s; freelistsize: %s;
pageblocks: %s\n,
stat.poolsize, stat.usedsize, stat.freeblocks, stat.freelistsize,
stat.pageblocks);
}

int main(){
printGC();

size_t len = 256 * 1024 * 1024;
auto b = new byte[len];

writefln(after allocating %s bytes, len);
printGC();

delete b;
b = null;

GC.collect();
writefln(after std.gc.fullCollect:);
printGC();

GC.minimize();
writefln(after std.gc.minimize:);
printGC();

return 0;
}
--
poolsize: 65536; usedsize: 256; freeblocks: 15; freelistsize: 3840;
pageblocks: 0

after allocating 268435456 bytes
poolsize: 268566528; usedsize: 256; freeblocks: 30; freelistsize: 3840;
pageblocks: 1

after std.gc.fullCollect:
poolsize: 268566528; usedsize: 256; freeblocks: 65567; freelistsize: 3840;
pageblocks: 0

after std.gc.minimize:
poolsize: 65536; usedsize: 256; freeblocks: 15; freelistsize: 3840;
pageblocks: 0
--
Still fixed in D2 and D1 also has an implementation
https://github.com/D-Programming-Language/druntime/blob/D1.0/src/gc/basic/gcx.d#L1917.

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


[Issue 7313] New: the result of a 'new' expression should implicitly cast to (im)mutable

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7313

   Summary: the result of a 'new' expression should implicitly
cast to (im)mutable
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 11:20:40 PST ---
the following code should compile:
void main(){
immutable a = new int[1];
int[] b = new immutable(int)[1];
}

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


[Issue 7131] [tdpl] Hijacking detected where it doesn't exist

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7131



--- Comment #3 from d...@dawgfoto.de 2012-01-18 11:27:48 PST ---
OK, std.string and std.regex should implicitly form
two overload sets. As the resolved set in std.string
is empty std.regex.split should be called.

http://www.d-programming-language.org/hijack.html

I will take a look at this when I find some time.

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


[Issue 7310] strongly pure function results should implicitly cast to mutable, shared, and inout

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310


timon.g...@gmx.ch changed:

   What|Removed |Added

Summary|pure function results   |strongly pure function
   |should implicitly cast to   |results should implicitly
   |mutable |cast to mutable, shared,
   ||and inout


--- Comment #1 from timon.g...@gmx.ch 2012-01-18 11:55:27 PST ---
On second thought, this should be the case for all type qualifiers.
The following code should compile too:

inout(int)[] foo(inout int)pure{return new int[1];}
shared(int)[] foo()pure{return new int[1];}
int[] bar()pure{return new int[1];}
inout(int)[] bar(inout int){inout r = bar(); return r;}
void main(){shared(int)[] a = bar();}

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


[Issue 7310] pure function results should implicitly cast to mutable, shared, and inout

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310


timon.g...@gmx.ch changed:

   What|Removed |Added

Summary|strongly pure function  |pure function results
   |results should implicitly   |should implicitly cast to
   |cast to mutable, shared,|mutable, shared, and inout
   |and inout   |
   Severity|normal  |enhancement


--- Comment #2 from timon.g...@gmx.ch 2012-01-18 12:01:45 PST ---
Of course, there have to be some additional constraints: Namely, if the return
value should implicitly convert to qualifier, the function parameters all
have to implicitly convert to qualifier. This could even be checked at call
site:

const(int)[] foo(const(int)[] x)pure{return x;}
void main(){
int[] x = new int[1];
int[] y = foo(x); // perfectly fine
}

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


[Issue 7314] New: strong purity should be inferred at call site

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7314

   Summary: strong purity should be inferred at call site
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 12:05:05 PST ---
Currently, a function is considered to be strongly pure if all its formal
parameters implicitly convert to immutable.
But a function invocation can be considered strongly pure if all actual
arguments are implicitly convertible to immutable.

The following code should compile:

const(int)[] foo(const(int)[] x)pure{return x;}
void main(){
immutable(int)[] x;
immutable(int)[] y = foo(x);
}

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


[Issue 3735] op=

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3735



--- Comment #2 from Don clugd...@yahoo.com.au 2012-01-18 12:06:10 PST ---
Apart from Stewart's comment, there's also the case of .

a = b is different to a = a  b, if a is short or byte.

(The first does an unsigned shift, the second does a signed shift).

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


[Issue 3735] op=

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3735


timon.g...@gmx.ch changed:

   What|Removed |Added

 CC||timon.g...@gmx.ch


--- Comment #3 from timon.g...@gmx.ch 2012-01-18 12:18:44 PST ---
The same halds for other binary operators. The sentence should probably just be
removed from the spec.

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


[Issue 107] Wrong filename in error message when using a mixin

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=107


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

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #12 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
12:50:30 PST ---
Yup, verified fixed.

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


[Issue 107] Wrong filename in error message when using a mixin

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=107



--- Comment #13 from Andrei Alexandrescu and...@metalanguage.com 2012-01-18 
13:48:27 PST ---
Thanks!

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #22 from Jonathan M Davis jmdavisp...@gmx.com 2012-01-18 13:50:26 
PST ---
 `if (x = foo())` can't work, so I don't know why `switch (x = foo())` can.

That's easy. With if, there's a strong possibility that the programmer really
meant to use ==. So, by disallowing = by itself, you avoid those bugs (though
it would certainly be nice to be able to do if(x = foo()) - gcc allows it
without complaining if you add extra parens (though IIRC Visual Studio doesn't
like it) - if((x = foo()) - but I don't think that D has anything of the sort).

However, the switch statement requires a value, not an expression, so the risk
of = being used instead of == is pretty much zero. So, disallowing it for
switch doesn't really benefit anyone.

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


[Issue 7312] const should be abstract

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7312


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

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2012-01-18 13:55:00 
PST ---
I can see why it would be considered bad practice to return const from a
strongly pure function, but why should it be disallowed by the compiler?

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


[Issue 4549] D2 Language Docs: http://www.digitalmars.com/d/2.0/expression.html

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4549


Andrej Mitrovic andrej.mitrov...@gmail.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-01-18 
13:53:44 PST ---
http://github.com/D-Programming-Language/d-programming-language.org/pull/52

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


[Issue 7313] the result of a 'new' expression should implicitly cast to (im)mutable

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7313


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

   What|Removed |Added

 CC||jmdavisp...@gmx.com
   Platform|Other   |All
 OS/Version|Linux   |All


--- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2012-01-18 13:56:46 
PST ---
I can see why that would be nice with regards to primitives, but I would point
out that that wouldn't work with structs or classes (or with arrays of structs
or classes).

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


[Issue 150] std.gc.minimize doesn't minimize physical memory usage

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=150


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

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||bugzi...@digitalmars.com
 Resolution|FIXED   |


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
14:00:06 PST ---
Recoding the test case for D1 Phobos:
---
import std.gc;
import std.stdio;
import gcstats;

extern(C) GCStats gc_stats();

void printGC(){
GCStats stat;
getStats(stat);

writefln(poolsize: %s; usedsize: %s; freeblocks: %s; freelistsize: %s;
pageblocks: %s\n,
stat.poolsize, stat.usedsize, stat.freeblocks, stat.freelistsize,
stat.pageblocks);
}

int main(){
printGC();

size_t len = 256 * 1024 * 1024;
auto b = new byte[len];

writefln(after allocating %s bytes, len);
printGC();

delete b;
b = null;

std.gc.fullCollect();
writefln(after std.gc.fullCollect:);
printGC();

std.gc.minimize();
writefln(after std.gc.minimize:);
printGC();

return 0;
}

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


[Issue 4736] http://www.digitalmars.com/d/2.0/hash-map.html

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4736


Andrej Mitrovic andrej.mitrov...@gmail.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 150] std.gc.minimize doesn't minimize physical memory usage

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=150



--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
14:04:35 PST ---
I folded in Leandro's patch, but the problem remains.

(D1 only.)

https://github.com/D-Programming-Language/phobos/commit/25616cf9790084a7b1b3db6d3aa8e910b9195445

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


[Issue 7312] const should be abstract

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7312


timon.g...@gmx.ch changed:

   What|Removed |Added

   Priority|P2  |P3


--- Comment #2 from timon.g...@gmx.ch 2012-01-18 14:25:22 PST ---
Immutable has all the constraints const has and gives actual guarantees. I
don't think it is very important to enforce it, but it would be a net gain.

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


[Issue 7313] the result of a 'new' expression should implicitly cast to (im)mutable

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7313



--- Comment #2 from timon.g...@gmx.ch 2012-01-18 14:28:35 PST ---
It works with any type that has a pure constructor where all (unscoped)
constructor arguments convert to the respective qualifier.

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


[Issue 7314] strong purity should be inferred at call site

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7314


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2012-01-18 14:49:09 PST ---
I think there are ways to further improve this idea. And I think such ideas
will lead to quite useful code. I have recently written two posts about related
ideas. I think this is an improvement.


But I think language complexity too should be kept into account. When a
programmer writes code like this:


auto foo(...) pure { ... }
void main() {
immutable x = foo(...);
}


She should be able to usually guess correctly if such code is correct, or if it
doesn't compile. The more complex D purity becomes, the less easy is to
remember all the rules and exceptions to the rule, and this increases the risk
of turning  programming more into guesswork than design. This sometimes happens
even if every single rule looks like an improvement.

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


[Issue 7315] New: 'out' parameters should be covariant

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7315

   Summary: 'out' parameters should be covariant
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 15:17:24 PST ---
The following code should compile:
class A{
void foo(out A a){
a=new A;
}
}
class B:A{
override void foo(out B b){
b=new B;
}
}

void main(){
A a;
B b = new B;
b.foo(a);
}

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #23 from Stewart Gordon s...@iname.com 2012-01-18 15:26:46 PST ---
(In reply to comment #18)
 What would it be anyway - just an optional check for the programmer
 similar to the override attribute?
 
 override will stop being optional, see issue 3836. Likewise this was not meant
 to be optional, eventually.

This wouldn't make sense - why should I be forced to add something just to show
I know that all the case values are compile-time constants?

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


[Issue 7310] pure function results should implicitly cast to mutable, shared, and inout

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310


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

   What|Removed |Added

 CC||s...@iname.com


--- Comment #3 from Stewart Gordon s...@iname.com 2012-01-18 15:32:54 PST ---
I'm not sure about this.  If a function is pure, then multiple calls with the
same arguments (or even that return the same value) can potentially be
optimised to all use the same copy of the data.  Implicit cast to mutable would
mess this up, unless we define the implicit conversion to .dup the result.

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


[Issue 7310] pure function results should implicitly cast to mutable, shared, and inout

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310



--- Comment #4 from timon.g...@gmx.ch 2012-01-18 15:40:51 PST ---
The analysis would just have to detect whether or not such an implicit
conversion has happened. The compiler has all the information, I don't think it
is an issue.

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


[Issue 7310] pure function results should implicitly cast to mutable, shared, and inout

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310



--- Comment #5 from timon.g...@gmx.ch 2012-01-18 15:42:35 PST ---
Furthermore, the optimization also applies when it is the other way round
(mutable return value implicitly converted to immutable), so the analysis would
consider implicit conversions of the return value anyway.

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


[Issue 6176] [tdpl] Cannot use string variables in case expressions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #24 from bearophile_h...@eml.cc 2012-01-18 16:06:09 PST ---
(In reply to comment #23)

 This wouldn't make sense - why should I be forced to add something just to 
 show
 I know that all the case values are compile-time constants?

Let's assume in one case you want the compiler to produce a very efficient
switch, maybe because you are writing the main loop of a little interpreter. In
this case you don't want one of the cases to be on a runtime value _by your
mistake_, because this may break this compiler optimization, forcing a less
efficient compilation of the switch. So to be sure you are not doing such
mistakes, you add an annotation to the switch, and the compiler catches your
mistakes.

In the end I agree this is probably not necessary, and it's better for switch
cases to be required to always be compile-time constants, losing a bit of
switch flexibility.

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


[Issue 3735] op=

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3735



--- Comment #4 from Stewart Gordon s...@iname.com 2012-01-18 16:31:48 PST ---
(In reply to comment #2)
 Apart from Stewart's comment, there's also the case of .
 
 a = b is different to a = a  b, if a is short or byte.
 
 (The first does an unsigned shift, the second does a signed shift).

Oh yes, that crazy abomination that is promotion.  Suppose you have

byte a = cast(byte) 0b;  // why does it insist on a cast?
a = a  3;

then what actually happens is

0b  3
promote to int
0b  3
apply shift
0b0000
convert back to a byte
0b1110

If you shift by 25 or more (17 or more for short), you'll start to see the zero
bits come through.

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


[Issue 3735] op=

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3735



--- Comment #5 from timon.g...@gmx.ch 2012-01-18 16:36:54 PST ---
(In reply to comment #4)
 byte a = cast(byte) 0b;  // why does it insist on a cast?

Because 240 does not fit inside the range -128 to 127.
static assert(0b != cast(byte)0b);

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


[Issue 7310] pure function results should implicitly cast to mutable, shared, and inout

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310


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

   What|Removed |Added

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


--- Comment #6 from Don clugd...@yahoo.com.au 2012-01-18 16:57:39 PST ---
(In reply to comment #5)
 Furthermore, the optimization also applies when it is the other way round
 (mutable return value implicitly converted to immutable), so the analysis 
 would
 consider implicit conversions of the return value anyway.

No. The only way an immutably pure function can return a mutable value, is if
it created it itself -- so we know it's unique. No analysis of the body of the
function is required.

But, if an immutable pure function returns an immutable value, we know nothing.
It could be a parameter, or an immutable global variable, or a variable created
inside the function.

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


[Issue 7310] pure function results should implicitly cast to mutable, shared, and inout

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7310


timon.g...@gmx.ch changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #7 from timon.g...@gmx.ch 2012-01-18 17:09:48 PST ---
(In reply to comment #6)
 (In reply to comment #5)
  Furthermore, the optimization also applies when it is the other way round
  (mutable return value implicitly converted to immutable), so the analysis 
  would
  consider implicit conversions of the return value anyway.
 
 No. The only way an immutably pure function can return a mutable value, is if
 it created it itself -- so we know it's unique. No analysis of the body of the
 function is required.

This is not what I was suggesting. I am only reasoning about the call-site
here.

 
 But, if an immutable pure function returns an immutable value, we know 
 nothing.
 It could be a parameter, or an immutable global variable, or a variable 
 created
 inside the function.

For parameter, see comment #2. immutable global variables are a deal-breaker.
Implicitly casting between shared and unshared should still be possible at
strongly pure function border. I am opening a separate issue for it.

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


[Issue 7296] [2.058] Regression: Cannot swap RefCounted

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7296


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 CC||bra...@puremagic.com
 AssignedTo|nob...@puremagic.com|and...@metalanguage.com
   Target Milestone|--- |2.058


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


[Issue 7316] New: the result of a strongly pure function should implicitly convert to and from shared

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7316

   Summary: the result of a strongly pure function should
implicitly convert to and from shared
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 17:13:54 PST ---
The following code should compile:

int[] foo()pure{return new shared(int)[1];}
shared(int)[] bar()pure{return new int[2];}
void main(){
shared a = foo();
int[] b = bar();
}

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


[Issue 7293] dmd 2.057 segfault

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7293


Gary Slopsema gslopsema+dbugzi...@gmail.com changed:

   What|Removed |Added

 CC||gslopsema+dbugzilla@gmail.c
   ||om


--- Comment #1 from Gary Slopsema gslopsema+dbugzi...@gmail.com 2012-01-18 
17:43:53 PST ---
Confirmed on Windows 7 x86.

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


[Issue 6178] Struct inside the AA are not init correctly

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6178



--- Comment #6 from Jose Garcia jsan...@gmail.com 2012-01-18 18:22:55 PST ---
Andrei,

Do you still get the compiler internal error with -0? See bug 6177.

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


[Issue 6874] heap corruption caused by std.array.insertInPlaceImpl or gc.gcx

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6874


Nils mailm...@nilsb.dyndns.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #2 from Nils mailm...@nilsb.dyndns.org 2012-01-18 18:27:00 PST ---
https://github.com/D-Programming-Language/phobos/commit/ae112b9dea12afa7bcba4c118f675ed8e8ff5ca2

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


[Issue 7141] std.regex - escaped characters can form operators in character classes

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7141



--- Comment #1 from Nils mailm...@nilsb.dyndns.org 2012-01-18 18:27:39 PST ---
https://github.com/D-Programming-Language/phobos/pull/377

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


[Issue 7302] std.conv.parse with radix doesn't work on ranges

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7302



--- Comment #1 from Nils mailm...@nilsb.dyndns.org 2012-01-18 18:28:18 PST ---
https://github.com/D-Programming-Language/phobos/pull/396

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


[Issue 3922] Refuse returning nonvoid from void functions

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3922


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||yebbl...@gmail.com
 Resolution||FIXED


--- Comment #14 from yebblies yebbl...@gmail.com 2012-01-19 13:44:18 EST ---
As far as I can tell, this bug has been fixed with issue 3746 and issue 5399.
Returning a value from a void function is only allowed when the value evaluates
to void, preventing the value from being lost accidentally.

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


[Issue 5941] Using inner struct which references nested function in a no-attribute or auto-return member function causes nested function cannot be accessed error

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5941


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #4 from yebblies yebbl...@gmail.com 2012-01-19 14:04:52 EST ---
In case anyone's wondering about why adding attributes changes anything, the
compiler does a scan of all the top level members in a nested struct to
determine if it contains any functions, and makes it a static struct otherwise.
 This is unfortunately done badly/too early and it finds AttributeDeclarations
containing functions but doesn't investigate further.
Given that, it sounds like the requirement for having no attributes is really
just a requirement for a non-static nested struct.

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


[Issue 5974] Incorrect nested function address in expression (f).ptr

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5974


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #2 from yebblies yebbl...@gmail.com 2012-01-19 14:10:45 EST ---
(In reply to comment #0)
 Second, why f is not an lvalue error occurs for (f).funcptr? Maybe, I
 don't understand something?

iirc this fails because dmd rewrites dg.funcptr as *(cast(void**)(dg)+1),
which naturally doesn't work on an rvalue.  The way to fix this is to rewrite
it as cast(void*)(cast(uint64/128)dg  32/64), the same way array length
is accessed.

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


[Issue 4180] D DWARF extensions conflict with DWARF-4

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4180


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
20:47:23 PST ---
https://github.com/D-Programming-Language/dmd/commit/f37b75512ccc307ef3d6ff7a5fdda36181422de2

https://github.com/D-Programming-Language/dmd/commit/e81dbc265d91fec7bafd79b3845b42bc47fc70b8

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


[Issue 4154] Incorrect DWARF section names on Mac

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4154



--- Comment #15 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
20:50:34 PST ---
Is this still an issue or not?

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


[Issue 4149] refs displayed as pointers in gdb

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4149



--- Comment #10 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
20:52:37 PST ---
Can this be turned into a pull request?

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


[Issue 3657] No lexical scope for local variables in debug info

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3657


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #2 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
20:55:44 PST ---
Want to do a pull request for this?

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


[Issue 4149] refs displayed as pointers in gdb

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4149



--- Comment #11 from Brad Roberts bra...@puremagic.com 2012-01-18 20:55:55 
PST ---
Last time I played with this diff on current code, it caused failures.  I
haven't looked at in any detail in ages and I'm fairly sure it's rather
incomplete now that I know more about the backend.

The bug is still real though.

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


[Issue 3391] gdb: dynamic arrays and associative arrays are not properly printed

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3391


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2012-01-18 
20:56:59 PST ---
Fixed by pull 526.

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


[Issue 4154] Incorrect DWARF section names on Mac

2012-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4154


d...@dawgfoto.de changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #16 from d...@dawgfoto.de 2012-01-18 21:39:00 PST ---
Nope, the underscore fix is already in the compiler.

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