[Issue 3474] PATCH: Implement opDollar for struct and class indexing operations

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3474



--- Comment #11 from bearophile_h...@eml.cc 2011-11-22 00:05:51 PST ---
With the recent patch this doesn't compile, is this expected?


struct Foo {
int x;
alias x opDollar;
int opIndex(int k) { return x * k; }
}
void main() {
Foo f = Foo(7);
int x = f[$ - 5]; // Error: undefined identifier __dollar
assert(x == 2 * 7);
}

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


[Issue 3474] PATCH: Implement opDollar for struct and class indexing operations

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3474



--- Comment #12 from Don  2011-11-22 00:30:59 PST ---
(In reply to comment #11)
> With the recent patch this doesn't compile, is this expected?
> 
> 
> struct Foo {
> int x;
> alias x opDollar;
> int opIndex(int k) { return x * k; }
> }
> void main() {
> Foo f = Foo(7);
> int x = f[$ - 5]; // Error: undefined identifier __dollar
> assert(x == 2 * 7);
> }

Yes, it checks that opDollar is either a function or a template function.

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


[Issue 3474] PATCH: Implement opDollar for struct and class indexing operations

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3474



--- Comment #13 from Don  2011-11-22 00:43:02 PST ---
Poor error message though. All the overloaded operators have bad errors:

struct S {
   void x() {}
   alias x opUnary;
}

void main() {
S a;
a = -a;
}

test.d(9): Error: a.x isn't a template

struct S {
   int x;
   alias x opUnary;
}

void main() {
S a;
a = -a;
}
test.d(9): Error: 'a' is not of arithmetic type, it is a S

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


[Issue 3474] PATCH: Implement opDollar for struct and class indexing operations

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3474


Walter Bright  changed:

   What|Removed |Added

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


--- Comment #14 from Walter Bright  2011-11-22 
02:56:58 PST ---
https://github.com/D-Programming-Language/dmd/commit/aba0f773416e1d45d227159cb22ad0e26bb980c0

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


[Issue 6986] SortedRange[x..$] fails with unidentified __dollar

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6986


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

   What|Removed |Added

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


--- Comment #4 from timon.g...@gmx.ch 2011-11-22 03:49:48 PST ---
The rewrite from $ to .length does not work if a range has no predetermined
length (eg. if it is infinite or corresponds to an input stream)

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


[Issue 6987] The "Memory Management" documentation incorrectly claims arrays are passed by reference.

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6987



--- Comment #1 from Bernard Helyer  2011-11-22 
03:53:26 PST ---
I would suggest something like

"as the contents of an array are accessed through a reference..."

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


[Issue 6987] New: The "Memory Management" documentation incorrectly claims arrays are passed by reference.

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6987

   Summary: The "Memory Management" documentation incorrectly
claims arrays are passed by reference.
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: websites
AssignedTo: nob...@puremagic.com
ReportedBy: blood.of.l...@gmail.com


--- Comment #0 from Bernard Helyer  2011-11-22 
03:50:14 PST ---
http://www.d-programming-language.org/memory.html

>Consider the case of passing an array to a function, possibly modifying the 
>contents of the array, and returning the modified array. Since arrays are 
>passed 
>by reference, not by value, a crucial issue is who owns the contents of the 
>array?

The semantics of using an array passed to a function may be reference like, but
the array is most certainly not 'passed by reference'. Glossing this over will
lead to confusion for people later on when they resize an array passed to a
function and wonder why the changes haven't been reflected at the call site.

-- 
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

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4180


Trass3r  changed:

   What|Removed |Added

 CC||mrmoc...@gmx.de


--- Comment #3 from Trass3r  2011-11-22 04:10:27 PST ---
http://sourceware.org/ml/gdb/2011-11/msg00103.html

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


[Issue 6988] New: char[] chars = ['�','�','�']; should not compile

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6988

   Summary: char[] chars = ['�','�','�']; should not compile
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: and...@metalanguage.com


--- Comment #0 from Andrei Alexandrescu  2011-11-22 
09:13:42 PST ---
unittest
{
char[] chars = ['�','�','�'];
assert(chars == "���");
}

The assertion fails for the obvious reason there's no room in chars for the
multibyte characters. The initialization should not compile because it attempts
to truncate wide characters into meaningless bytes.

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


[Issue 6988] char a = '�'; should not compile

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6988


Trass3r  changed:

   What|Removed |Added

   Keywords||accepts-invalid, diagnostic
 CC||mrmoc...@gmx.de
Summary|char[] chars =  |char a = '�'; should not
   |['�','�','�']; should not   |compile
   |compile |


--- Comment #1 from Trass3r  2011-11-22 12:19:23 PST ---
It's more general:

void main()
{
char a = '�'; // compiles fine
}

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


[Issue 6189] register content destroyed in function prolog

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6189



--- Comment #5 from d...@dawgfoto.de 2011-11-22 12:53:46 PST ---
This test case doesn't reproduce the bug since xmmregs
are used for floating point.
Disabling fpxmmregs still reproduces the bug.

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


[Issue 6989] New: Implement toString for std.concurrency.Tid

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6989

   Summary: Implement toString for std.concurrency.Tid
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-11-22 
13:11:43 PST ---
Currently calling write() on a Tid prints:
Tid(std.concurrency.MessageBox)

In earlier versions this used to be:
Tid

In either case, this isn't much information. I think it would be useful if
toString was overloaded and returned a string with some sort of unique thread
ID, e.g.:

writeln(spawn(&test));  // Tid(0x0001)

This could make it easier to debug some types of threading problems without
having to use a debugger.

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


[Issue 6990] New: std.string.splitlines deprecation doc missing a word

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6990

   Summary: std.string.splitlines deprecation doc missing a word
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-11-22 
17:16:29 PST ---
http://d-programming-language.org/phobos/std_string.html#splitlines

"Scheduled for deprecation in January 2012. Please use instead."

should be:

"Scheduled for deprecation in January 2012. Please use *splitLines* instead."

Not sure why it's not generated like that, the code is:

 * $(RED Scheduled for deprecation in January 2012.
 *   Please use $(LREF, splitLines) instead.)

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


[Issue 6990] std.string.splitlines deprecation doc missing a word

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6990


Jonathan M Davis  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jmdavisp...@gmx.com
 Resolution||FIXED


--- Comment #1 from Jonathan M Davis  2011-11-22 19:05:54 
PST ---
It's because the comma shouldn't be there. Fixed.

https://github.com/D-Programming-Language/phobos/commit/5d90bc3f10cd272e42629e5c03f2e8dabb1eb6cc

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


[Issue 6991] New: Symbol not found when using function-local imports

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6991

   Summary: Symbol not found when using function-local imports
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-11-22 
19:32:22 PST ---
import std.stdio;
// import std.cpuid : threadsPerCPU;  // ok

void main()
{
import std.cpuid : threadsPerCPU;  
writeln(threadsPerCPU);  // NG, undefined identifier threadsPerCPU
}

It doesn't complain about the import, but only when used in a function call,
and only if it's imported within the function.

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


[Issue 6992] New: Implement radix conversion for std.conv.to

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6992

   Summary: Implement radix conversion for std.conv.to
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-11-22 
20:21:40 PST ---
import std.conv;
import std.stdio;

void main()
{
   writeln(parse!int("ff", 16));  // ok
   writeln(to!int("ff", 16)); // NG
}

parse works ok with literals, but not with strings:

string get() { return "ff"; }
void main()
{
   writeln(parse!int(get(), 16));
}

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


[Issue 6993] New: File.byLine runs on an empty file, fails enforcement

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6993

   Summary: File.byLine runs on an empty file, fails enforcement
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: major
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-11-22 
21:04:53 PST ---
Create a new file "empty.d" and run this:

import std.stdio;

void main()
{
auto file = File("empty.d", "r");
foreach (aLine; file.byLine)
{
}
}

object.Exception@D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\stdio.d(943):
Enforcement failed

Line 943:
enforce(file.isOpen);

So the file was not successfully opened, but why wasn't an exception thrown in
the File constructor then?

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


[Issue 6993] File.byLine runs on an empty file, fails enforcement

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6993


Jonathan M Davis  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jmdavisp...@gmx.com
 Resolution||DUPLICATE


--- Comment #1 from Jonathan M Davis  2011-11-22 21:49:06 
PST ---
I don't see any reason why an exception would be thrown from File's constructor
for an empty file. It certainly doesn't say that it does. The problem is that
ByLine clearly isn't set up to handle empty files correctly.

Duplicate of Bug# 6944

*** This issue has been marked as a duplicate of issue 6944 ***

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


[Issue 6944] stdio.File.byLine can't handle an empty file

2011-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6944


Jonathan M Davis  changed:

   What|Removed |Added

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


--- Comment #2 from Jonathan M Davis  2011-11-22 21:49:07 
PST ---
*** Issue 6993 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: ---