[Issue 5835] Class array's TypeInfo.getHash doesn't work correctly

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5835


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||patch


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2011-04-11 22:55:45 PDT ---
Changed.
- Removing getInternalTypeInfo is too strict.
- Changed internal TypeInfo of class array - typeid(Object[])
- TypeInfo_AC is only used for TypeInfo class of typeid(user class array).

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


[Issue 4048] [CTFE] struct initializer

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4048


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

   What|Removed |Added

   Keywords|rejects-valid   |diagnostic


--- Comment #1 from Don clugd...@yahoo.com.au 2011-04-12 00:18:00 PDT ---
The rejects-valid aspect of this bug is a duplicate of bug 3792.

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


[Issue 693] 'this' can't be used as an alias parameter for a mixin

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693


Simen Kjaeraas simen.kja...@gmail.com changed:

   What|Removed |Added

 CC||simen.kja...@gmail.com


--- Comment #2 from Simen Kjaeraas simen.kja...@gmail.com 2011-04-12 01:57:39 
PDT ---
This also a problem for non-mixin templates:

struct MyCallable {
int opCall( int n ) {
return n;
}

auto mapthis( int[] arr ) {
return map!this( arr );
}
}

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


[Issue 1309] sorting arrays of structs is broken

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1309


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||k.hara...@gmail.com
 Resolution||FIXED


--- Comment #8 from Kenji Hara k.hara...@gmail.com 2011-04-12 02:36:01 PDT ---
On trunk dmd, this code works. 


import std.stdio;
import std.random;

struct MyStruct
{
uint field;

//int opCmp(MyStruct* m)
int opCmp(ref const(MyStruct) m) const
{
writeln(This is opCmp);
return field - m.field;
}
}

void main()
{
MyStruct[] structs;
for(int i=0;i50;i++)
structs ~= MyStruct(50-i);

structs.sort;

foreach(s;structs)
writeln(s.field);
}

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


[Issue 693] 'this' can't be used as an alias parameter for a mixin

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693



--- Comment #3 from Simen Kjaeraas simen.kja...@gmail.com 2011-04-12 03:01:10 
PDT ---
Thinking about this some more, fixing this bug could lead to safer array
indexing for one, through a limited system of dependent types:

struct SafeArray( T ) {
T[] data;

struct Index( alias arr ) {
size_t idx;
// Add safety checks, overflow handling, etc.
}

Index!this makeIndex( size_t n ) {
typeof( return ) result;
result.idx = n;
return result;
}

T opIndex( Index!this idx ) {
return data[idx.idx];
}
}

unittest {
SafeArray!int arr;
arr.data = [1,2,3,4,5,6,7,8,9,0];
auto idx = arr.makeIndex( 3 );
writeln( arr[idx] ); // Completely safe indexing of array, enforced by type
system.
}

There may be a problem in that compiler considers 'this' a local parameter to a
non-global template, which is currently illegal. Not sure how much of a problem
this might be in practice.

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


[Issue 3916] opEquals for objects does not respect const

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3916


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||k.hara...@gmail.com
 Resolution||DUPLICATE


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-04-12 03:13:52 PDT ---
*** This issue has been marked as a duplicate of issue 1824 ***

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


[Issue 1824] Object not const correct

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1824


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 CC||schvei...@yahoo.com


--- Comment #9 from Kenji Hara k.hara...@gmail.com 2011-04-12 03:13:52 PDT ---
*** Issue 3916 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 1824] Object not const correct

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1824



--- Comment #10 from Steven Schveighoffer schvei...@yahoo.com 2011-04-12 
06:35:27 PDT ---
Just a note regarding bug 3916, the issue extends into the global opEquals
function for object, it must also be const correct.

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


[Issue 5821] Calling spawn in std.concurrency without all the parameters required by void function(T) fn

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5821


Andriy andr...@gmail.com changed:

   What|Removed |Added

 CC||andr...@gmail.com


--- Comment #1 from Andriy andr...@gmail.com 2011-04-12 08:55:29 PDT ---
Seems more like it's language:
  arg: 100
  arg: 134851556 (any number actually)
is printed by the following which should not compile:

import std.stdio;

void func(int value){
writeln(arg: ,value);
}

void myspawn(T...)( void function(T) fn, T args ){
fn(args);
}

void main(){
myspawn(func,100);
myspawn(func); 
}

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


[Issue 3650] functions are considered pointers

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3650


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

   What|Removed |Added

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


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2011-04-12 
11:15:01 PDT ---
void function() foo;

declares foo as a function pointer.

is(T T2 : T2*)

matches a pointer, and sets T2 to whatever is pointed to.

Hence what is printed out is correct. Not a bug.

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


[Issue 5780] [patch] std.traits.hasIndirections incorrectly handles static arrays

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5780


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 2011-04-12 16:14:07 PDT ---
https://github.com/D-Programming-Language/phobos/commit/3edf3bf1b77ef883676332aea4fe3d8d6ccba867

I didn't include the hasIndirectionsUnittest stuff, though, because it seems to
cause weird linker errors when -unittest is enabled, for reasons I don't
understand.

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


[Issue 5333] simple use of filter (from online doc) does not compile

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5333


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 2011-04-12 16:26:10 PDT ---
This appears to have been fixed in Git but not marked as such.

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


[Issue 5838] New: splitter and split names

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5838

   Summary: splitter and split names
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-04-12 17:18:57 PDT ---
From benchmarks I've seen that std.array.splitter() is often more efficient
than std.array.split(), probably because splitter doesn't allocate memory for
the array.

Python programmers (and maybe other programmers) are used to use split(),
despite often splitter() is enough for their purposes.

The splitter name is longer than split, but it's better to suggest D
programmers (and D programmes coming from Python) to use splitter() on default
instead of split().

So I suggest to give a shorter name to the lazy generator, and a longer name to
the function that returns an array. This is also more aligned to the naming in
std.algorithm where the short function names (like map and filter) are for the
lazy versions.

In bug 5756 I have suggested to add amap/afilter that approximately mean
array(map())/array(filter()). So the lazy splitter may be named just split
and the one that generates an array (that's similar to array(split())) may be
named asplit (if you want the prefix a may also be seen as the prefix of
the aeger word, instead of array).

So my renaming suggestions are:

split() == asplit()
splitter() == split()

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


[Issue 5756] amap() and maybe afilter() too

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5756



--- Comment #3 from bearophile_h...@eml.cc 2011-04-12 17:19:56 PDT ---
See also bug 5838

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


[Issue 5474] unaryFun byRef is borked for custom parameter name

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5474


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

   What|Removed |Added

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


--- Comment #1 from David Simcha dsim...@yahoo.com 2011-04-12 17:29:33 PDT ---
https://github.com/D-Programming-Language/phobos/commit/1578be026e5a8c99036b41e01dafc857205bc2d7

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


[Issue 5538] Immutable classes can't be passed as messages in std.concurrency

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5538


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

   What|Removed |Added

 CC||dsim...@yahoo.com


--- Comment #1 from David Simcha dsim...@yahoo.com 2011-04-12 17:41:07 PDT ---
https://github.com/D-Programming-Language/phobos/commit/325a8fe64a15c57dcde3f8326ad35cfd638f86c7

Fixed the Rebindable part.  Hopefully the Variant part will be fixed with Rob
Jacques's upcoming Variant update.

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


[Issue 5170] std.algorithm.copy works for non-assignable ranges

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5170


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

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #1 from David Simcha dsim...@yahoo.com 2011-04-12 17:44:35 PDT ---
This one looks to have been fixed a long time ago but never closed.

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


[Issue 5839] New: No error line number with did you mean of private symbol

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5839

   Summary: No error line number with did you mean of private
symbol
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: critical
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-04-12 18:21:06 PDT ---
D2 program:


import std.random;
void main() {
int[int] aa;
aa[seep] ~= 0;
}


DMD 2.052 shows an error without line number:

test.d: Error: module test std.random.seed is private
test.d(4): Error: undefined identifier seep, did you mean variable seed?


Marked as critical because Don asked me to do this in a comment of bug 5745

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