[Issue 5833] New: To read a key

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

   Summary: To read a key
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-04-10 23:09:48 PDT ---
If not already present, I think it's good to have in std.stdio a portable (on
Windows, Linux, etc) and reliable way to read a single char (key press).

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


[Issue 2776] pragma(lib, does not work when used in headers

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


Jacob Carlborg d...@me.com changed:

   What|Removed |Added

 CC||d...@me.com


--- Comment #6 from Jacob Carlborg d...@me.com 2011-04-11 00:27:47 PDT ---
DSSS/rebuild/bu(il)d adds its on pragma, pragma(link, ...), which basically
works like pragma(lib, ...) with this patch. Except when linking a library with
pragma(link) you only specify the name of the library and then it automatically
adds the extension depending on the platform. It also prefix the library name
with lib on Posix systems.

Could we add a pragma(link) that behaves as the one in DSSS/rebuild/bu(il)d,
this won't break any existing code, if I'm not missing something?

I would also like something for frameworks on Mac OS X, see:
http://d.puremagic.com/issues/show_bug.cgi?id=2968

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


[Issue 5833] To read a key

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com


--- Comment #1 from kenn...@gmail.com 2011-04-11 03:03:28 PDT ---
You mean like _getch() or just fgetc()?

_getch: http://msdn.microsoft.com/en-us/library/078sfkak(v=VS.100).aspx

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


[Issue 4943] In D2 Library spec sidebar, core.* links are dead

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


kenn...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||kenn...@gmail.com
 Resolution||FIXED


--- Comment #1 from kenn...@gmail.com 2011-04-11 03:07:54 PDT ---
Fixed quite a long time ago...

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


[Issue 4943] In D2 Library spec sidebar, core.* links are dead

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



--- Comment #2 from kenn...@gmail.com 2011-04-11 03:11:22 PDT ---
Note: The pages exist only in http://www.digitalmars.com/d/2.0. The core.*
links in http://d-programming-language.org/ are still 404.

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


[Issue 5834] New: Source of core.* should link to druntime, not phobos

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

   Summary: Source of core.* should link to druntime, not phobos
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: minor
  Priority: P2
 Component: websites
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-04-11 03:15:14 PDT ---
Source of core.* modules currently link to the Phobos github repository, e.g.
in core.atomic (http://www.digitalmars.com/d/2.0/phobos/core_atomic.html), the
Source links to

  https://github.com/D-Programming-Language/phobos/blob/master/core/atomic.d

which does not exist. The correct link should be

 
https://github.com/D-Programming-Language/druntime/blob/master/src/core/atomic.d
 ^^^

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


[Issue 5828] Cannot declare a variable of type X function() ref

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



--- Comment #1 from timon.g...@gmx.ch 2011-04-11 05:19:38 PDT ---
There is a typo:
I meant to write

//int function() ref f=g; //error

Instead of

//int function ref() f=g; //error

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


[Issue 176] [module] message module and package have the same name

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


Bernard Helyer blood.of.l...@gmail.com changed:

   What|Removed |Added

 CC||blood.of.l...@gmail.com


--- Comment #10 from Bernard Helyer blood.of.l...@gmail.com 2011-04-11 
05:45:41 PDT ---
This is an incredibly stupid message.

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


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

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

   Summary: Class array's TypeInfo.getHash doesn't work correctly
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara k.hara...@gmail.com 2011-04-11 05:52:31 PDT ---
Sample code:

import std.stdio;
class Foo{
  hash_t toHash(){ writeln(Foo.toHash); return 0; }
}
void main(){
  Foo[] arr = [new Foo(), new Foo()];
  typeid(arr).getHash(arr);  // doesn't call Foo.toHash()
}


The typeid(arr) returns instance of TypeInfo_Array, but its getHash is not call
Object.toHash of each element.

The internal TypeInfo class rt.typeinfo.ti_AC.TypeInfo_AC supports it, but this
is only used in array/associative-array operations.

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


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

2011-04-11 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 #1 from Kenji Hara k.hara...@gmail.com 2011-04-11 05:56:44 PDT ---
Patches:
https://github.com/9rnsr/dmd/compare/master...aa_hash_fix
https://github.com/9rnsr/druntime/compare/master...aa_hash_fix

Changes:
- TypeInfo_AC is derived from TypeInfo_Array.
- Class array's TypeInfo is instance of TypeInfo_AC.

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


[Issue 5836] New: std.typetuple.staticIndexOf missing %s in call to writefln

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

   Summary: std.typetuple.staticIndexOf missing %s in call to
writefln
   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 andrej.mitrov...@gmail.com 2011-04-11 
13:24:29 PDT ---
Example code is:
writefln(The index of long is ,
  staticIndexOf!(long, TypeTuple!(int, long, double)));
Should be:
writefln(The index of long is %s,
  staticIndexOf!(long, TypeTuple!(int, long, double)));

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


[Issue 5836] std.typetuple.staticIndexOf's example code missing %s in call to writefln

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com
Summary|std.typetuple.staticIndexOf |std.typetuple.staticIndexOf
   |missing %s in call to   |'s example code missing %s
   |writefln|in call to writefln


--- Comment #1 from kenn...@gmail.com 2011-04-11 13:35:05 PDT ---
Or change writefln to writeln.

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


[Issue 5837] New: Unable to format (writeln) an enum based on bool

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

   Summary: Unable to format (writeln) an enum based on bool
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-04-11 14:07:08 PDT ---
Test program:



import std.stdio;

enum A : bool { no, yes }

void main () {
writeln(A.no);
}



This results in an error:

/usr/include/phobos/std/format.d(1599): Error: template
std.format.formatValue(Writer,T,Char) if (is(const(T) == const(void[])))
formatValue(Writer,T,Char) if (is(const(T) == const(void[]))) matches more than
one template declaration,
/usr/include/phobos/std/format.d(868):formatValue(Writer,T,Char) if (is(T ==
enum)) and /usr/include/phobos/std/format.d(1079):formatValue(Writer,T,Char) if
(is(T : bool))

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


[Issue 4704] Problems with aa.byValue()

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com


--- Comment #1 from kenn...@gmail.com 2011-04-11 14:12:10 PDT ---
The 2nd program now (2.052) prints

int delegate(int delegate(ref int))

while the 3rd program now works correctly.

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


[Issue 4494] ICE(cod1.c) Array literal filled with results of void function

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


Iain Buclaw ibuc...@ubuntu.com changed:

   What|Removed |Added

   Keywords||patch


--- Comment #2 from Iain Buclaw ibuc...@ubuntu.com 2011-04-11 14:39:36 PDT ---
diff --git a/src/expression.c b/src/expression.c
index 9d116b9..1bd9e42 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -3200,6 +3200,10 @@ Expression *ArrayLiteralExp::semantic(Scope *sc)
 type = t0-arrayOf();
 //type = new TypeSArray(t0, new IntegerExp(elements-dim));
 type = type-semantic(loc, sc);
+
+if (type-nextOf()-ty == Tvoid)
+error(array literal of type void[] has no value);
+
 return this;
 }

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


[Issue 4494] ICE(cod1.c) Array literal filled with results of void function

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



--- Comment #3 from Iain Buclaw ibuc...@ubuntu.com 2011-04-11 14:44:50 PDT ---
Maybe

  if (type-nextOf()-ty == Tvoid)
  error(%s of type void[] has no value, toChars());


Is a better error message (I really am no good at writing them :)

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


[Issue 4984] string mixn results in dmd running out of memory

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com
Version|unspecified |D2
 OS/Version|Linux   |All


--- Comment #2 from kenn...@gmail.com 2011-04-11 14:46:35 PDT ---
This is likely due to the recursive template constraint used in
std.algorithm.startsWith. A reduced test case:

---

void x(U...)(U args) if ( is(typeof( x(args[1..$]) )) ) {
}

void x(U)(U u) {
}

void main() {
x(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
}

---

Similar test case:

---

void x(int n)() if (n  0  is(typeof(x!(n-1) ( {
}

void x(int n : 0)() {
}

void main() {
x!20();
}

---

Phobos could workaround this by moving the recursive part into a
static-if/static-assert.

(Note: I only check if it consumes an unusually large amount memory and does
not stop. I didn't wait until it runs out of memory.)

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


[Issue 4226] Can't forward reference identifier defined within a string mixin

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


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2011-04-11 
17:47:38 PDT ---
I think it should be a bug, though how fixable it is remains to be seen.

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


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

2011-04-11 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 #2 from Kenji Hara k.hara...@gmail.com 2011-04-11 19:34:45 PDT ---
Sorry, this patch has disabling optimizing problem.
I'll fix it.

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


[Issue 4767] dmd generates useless template bloat

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


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2011-04-11 
21:39:51 PDT ---
What matters is what gets into the exe file, not what's in the object files.

To that end, if you use dmd to generate a library file from source, it will
split each object file into multiple ones (one for each global symbol). Then,
only the referenced symbols get pulled in.

It's not a perfect solution, but it's a start.

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