[Issue 7497] optimizer/inliner misplaces load instruction

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7497


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #4 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:14:30 
PDT ---
(In reply to comment #2)
 At least on dmd 2.057..
 
 The 2.058 beta seems not to exhibit this behavior.

Can't reproduce on 2.059 Win32 either.

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


[Issue 7501] Array of function pointers append

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7501


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:16:28 
PDT ---
Works on 2.059 Win32

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


[Issue 7503] File[string] associative array cause Internal error: ../ztc/cgcs.c 162

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7503


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:24:11 
PDT ---
This one compiles on 2.059 Win32, but crashes with Access violation at
runtime.

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


[Issue 7507] DMD crashes when trying to call to!string on a float4 array property

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7507


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com
 OS/Version|Mac OS X|All


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:28:10 
PDT ---
2.059 Win32

PS E:\DigitalMars\dmd2\samples dmd bug.d
Internal error: ..\ztc\cg87.c 1699

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


[Issue 7508] float4 values aren't stored on initialisation

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7508


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:32:21 
PDT ---
2.059 Win32

PS E:\DigitalMars\dmd2\samples dmd bug.d
Internal error: ..\ztc\cg87.c 1699

See also http://d.puremagic.com/issues/show_bug.cgi?id=7507

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


[Issue 7509] Allow SIMD variable contents to have all their values changed to a single float variable

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7509


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com
   See Also||http://d.puremagic.com/issu
   ||es/show_bug.cgi?id=7507


--- Comment #4 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:35:47 
PDT ---
See also 
http://d.puremagic.com/issues/show_bug.cgi?id=7507
http://d.puremagic.com/issues/show_bug.cgi?id=7508

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


[Issue 7506] Postblit does not called properly with inlining

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7506


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:43:23 
PDT ---
See also issue 7516

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


[Issue 7522] ICE(interpret.c) Accessing a non-static member without this

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7522


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #4 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:47:47 
PDT ---
In 2.059 Win32

PS E:\DigitalMars\dmd2\samples dmd bug.d
bug.d(9): Error: need 'this' to access member a
PS E:\DigitalMars\dmd2\samples

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


[Issue 7526] void functions passed to getopt die

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7526


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:54:51 
PDT ---
See also issue 7426 and issue 7493

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


[Issue 7421] std.getopt does not work with shared types

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7421


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:53:59 
PDT ---
See also issue 7526 and issue 7693

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


[Issue 7526] void functions passed to getopt die

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7526



--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 00:57:20 
PDT ---
(In reply to comment #1)
 See also issue 7426 and issue 7493

Oh my, I meant issue 7421 and  issue 7693

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


[Issue 7522] ICE(interpret.c) Accessing a non-static member without this

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7522



--- Comment #5 from yebblies yebbl...@gmail.com 2012-04-20 17:57:44 EST ---
(In reply to comment #4)
 In 2.059 Win32
 
 PS E:\DigitalMars\dmd2\samples dmd bug.d
 bug.d(9): Error: need 'this' to access member a
 PS E:\DigitalMars\dmd2\samples

That's odd, I still get the assertion failure with 2.060 head. (now on line
103)
Were you using the exact code in the original comment?

Chances are this is a bug where something that should be dealt with during
semantic is dealt with in the glue layer.  Probably getRightThis and friends in
e2ir.c.

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


[Issue 7530] Postblit not called structs returned from an array index expr.

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7530


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 01:00:49 
PDT ---
See also issue 7516

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


[Issue 7516] Postblit not called for structs returned from a ternary operator

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7516



--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 01:01:16 
PDT ---
See also issue 7530

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


[Issue 7534] Allow attribute-overloading of an overridden method

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7534


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #10 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 01:05:33 
PDT ---
This compiles on 2.059

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


[Issue 7508] float4 values aren't stored on initialisation

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7508


Sean Cavanaugh worksonmymach...@gmail.com changed:

   What|Removed |Added

 CC||worksonmymach...@gmail.com


--- Comment #2 from Sean Cavanaugh worksonmymach...@gmail.com 2012-04-20 
01:11:39 PDT ---
See also:

http://d.puremagic.com/issues/show_bug.cgi?id=7413

This is preventing a lot of work from being able to be done on the simd
libraries.  Algorithms like sin, cos, require a lot of literal constants to
function, let alone several hundreds of constants  for a comprehensive set of
unit tests.

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


[Issue 7534] Allow attribute-overloading of an overridden method

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7534


Kenji Hara k.hara...@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 7522] ICE(interpret.c) Accessing a non-static member without this

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7522



--- Comment #6 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 01:21:42 
PDT ---
Oh sorry for the trouble, my bad.

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


[Issue 7453] Can't return value from within opApply

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7453


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

   What|Removed |Added

   Keywords|wrong-code  |pull, rejects-valid


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2012-04-20 01:37:22 PDT ---
Reduced test case:

struct S {
int opApply(int delegate(string) dg) {
return 0;
}
}
void main() {
foreach (_; S()) {
return;
// Error: long has no effect in expression (0)
// test.d(8): Error: cannot return non-void from void function
}
}

Pull request:
https://github.com/D-Programming-Language/dmd/pull/892

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


[Issue 7573] No line number with associative array creation error

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7573


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 01:48:07 
PDT ---
Compiles and runs(!) successfully on 2.059 Win32

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


[Issue 7575] [ICE] with possible forward reference error

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7575


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 01:52:56 
PDT ---
Compiles successfully on 2.059 Win32

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


[Issue 7574] No line number with forward reference error

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7574


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 01:50:03 
PDT ---
2.059 Win32 gives:

PS E:\DigitalMars\dmd2\samples rdmd bug.d
bug.d(3): Error: undefined identifier Spam

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


[Issue 7578] ICE on indexing result of vararg opDispatch

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7578


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #3 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:04:52 
PDT ---
Wow, that one compiles, but its execution on Windows XP (under Powershell)
starts the ntvdm.exe (16-bit Virtual Machine) !!

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


[Issue 7579] disabled postblit not checked for array appending

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7579


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:10:02 
PDT ---
Not sure I did the right thing, but I can't reproduce the error on Win32 2.059

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


[Issue 7598] format() doesn't work with alias this

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7598


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:18:41 
PDT ---
See also issue 7922

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


[Issue 7922] alias this causes weird formatting issues for strings

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7922


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:18:55 
PDT ---
See also 7598

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


[Issue 7947] New: typeof on anonymous function literal returns void

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7947

   Summary: typeof on anonymous function literal returns void
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ja...@aatch.net


--- Comment #0 from James Miller ja...@aatch.net 2012-04-20 02:19:04 PDT ---
The following code:

  pragma(msg, typeof(x = x));

prints out void. Semi understandable, if unintuitive.

this also does

  test(alias fn, T)(T t)
  if(is(typeof(fn(t
  {
pragma(msg, typeof(fn));
  }
  test!(x = x  5)(10);

Which is more annoying. There should either be an error in this case

Also happens with expanded function(...){...} syntax, as long as the parameter
types are not specified.

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


[Issue 7922] alias this causes weird formatting issues for strings

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7922



--- Comment #3 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:19:55 
PDT ---
(In reply to comment #2)
 See also 7598

See also issue 7598

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


[Issue 7599] Method parameter undefined in out-block

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7599


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com
   Platform|All |x86_64
 OS/Version|All |Mac OS X


--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:22:56 
PDT ---
Couldn't reproduce the bug on 2.059 WinXP.

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


[Issue 7501] Array of function pointers append

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7501


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2012-04-20 02:27:25 PDT ---
It was fixed in 2.059.

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

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


[Issue 7598] format() doesn't work with alias this

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7598



--- Comment #2 from Kenji Hara k.hara...@gmail.com 2012-04-20 02:30:27 PDT ---
(In reply to comment #1)
 See also issue 7922

No, this is std.string.format function problem, then it is Phobos issue.
And 7922 is a dmd issue. So they are not related.

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


[Issue 7615] Error aliasing an enum member through an alias of a type inside a struct

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7615


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:42:27 
PDT ---
This compiles on dmd 2.059 Win32

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


[Issue 7616] aggregates don't inherit pure nothrow from outer scope

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7616


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:46:05 
PDT ---
What do you mean by doesn't work ?
This code compiles on 2.059, but I'm not sure what you wanted to test.

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


[Issue 7947] typeof on anonymous function literal returns void

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7947



--- Comment #1 from Kenji Hara k.hara...@gmail.com 2012-04-20 02:47:58 PDT ---
A lambda expression that needs parameter type inference is internally
translated to template function.

  x = x
  // auto __lambda(T1)(T1 x){ return x; }

So this:

  pragma(msg, typeof(x = x));

is same as:

  pragma(msg, typeof(__lambda));
  // template itself has no type, then typeof(template) always returns void

And, long years, typeof(template) returns void.
Therefore, typeof(x = x) == void is current implementation design.

I don't know why typeof(template) returns void, but changing the behavior will
break some existing meta-programming codes.

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


[Issue 7522] ICE(interpret.c) Accessing a non-static member without this

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7522



--- Comment #7 from Don clugd...@yahoo.com.au 2012-04-20 02:48:04 PDT ---
(In reply to comment #5)
 (In reply to comment #4)
  In 2.059 Win32
  
  PS E:\DigitalMars\dmd2\samples dmd bug.d
  bug.d(9): Error: need 'this' to access member a
  PS E:\DigitalMars\dmd2\samples
 
 That's odd, I still get the assertion failure with 2.060 head. (now on line
 103)
 Were you using the exact code in the original comment?
 
 Chances are this is a bug where something that should be dealt with during
 semantic is dealt with in the glue layer.  Probably getRightThis and friends 
 in
 e2ir.c.

Exactly. There's still a fair number of those guys, they cause a lot of
problems for CTFE, and they also make it hard for GDC/LDC since they need to
generate those errors too.

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


[Issue 7647] ICE(machobj.c) with two main() functions

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7647


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com
   Severity|normal  |minor


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


[Issue 7643] Whole tuple slice isn't resolved as expected

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7643


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 02:56:46 
PDT ---
Compiles on 2.059 Win32.

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


[Issue 7643] Whole tuple slice isn't resolved as expected

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7643


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2012-04-20 03:13:26 PDT ---
https://github.com/D-Programming-Language/dmd/commit/28edc2597a9f1e802e3a2e18353b3038a5307ac5

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


[Issue 7637] writeln doesn't take custom toString into account

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7637



--- Comment #3 from Kenji Hara k.hara...@gmail.com 2012-04-20 03:11:31 PDT ---
This is current std.format design, not accepts-invalid bug.

Today, std.format.formatValue (it is internally used by writeln and writefln)
only supports following toString specializations:

http://dlang.org/phobos/std_format.html

const void toString(scope void delegate(const(char)[]) sink, FormatSpec fmt);
const void toString(scope void delegate(const(char)[]) sink, string fmt);
const void toString(scope void delegate(const(char)[]) sink);
const string toString();

If there is no toString() that matches required signatures, formatValue formats
the object with 'TypeName(field-formattings-separeted-with-comma)', instead of
reporting 'invalid toString signature detected' error.

There is two design decides:
- Ignoring invalid toString makes more user-defined types formattable.
- Shouldn't prevent any kind of toString that user really wants.

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


[Issue 4603] array(iota(1, 0)) error

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4603


bearophile_h...@eml.cc changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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


[Issue 7573] No line number with associative array creation error

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7573


bearophile_h...@eml.cc 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 7575] [ICE] with possible forward reference error

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7575


bearophile_h...@eml.cc 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 7918] Crash when using heredoc syntax in DMD v2.05[89] on Win7 [64bit]

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7918


Redger redger.lien...@gmail.com changed:

   What|Removed |Added

   Platform|All |x86_64
 OS/Version|All |Windows
   Severity|normal  |minor


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


[Issue 7832] opAssign does not get used for function parameters with a default value

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7832


William Moore nyphb...@gmail.com changed:

   What|Removed |Added

   Severity|normal  |enhancement


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


[Issue 7832] opAssign does not get used for function parameters with a default value

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7832



--- Comment #1 from William Moore nyphb...@gmail.com 2012-04-20 05:51:42 PDT 
---
It was late when I submitted this, so I wasn't thinking about what was actually
going on here.  The null assignment as a default parameter is treated as though
it were passed as an argument which would require some way to cast
implicitly  So given that, this really becomes a feature request for
implicit casting support.

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


[Issue 7918] Crash when using heredoc syntax in DMD v2.05[89] on Win7 [64bit]

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7918



--- Comment #2 from Dejan Lekic dejan.le...@gmail.com 2012-04-20 05:58:27 PDT 
---
(In reply to comment #1)
 Can you do something like this on Windows 7:
 
 C:\work powershell -Sta -NoProfile -NonInteractive -Command 
 $date = get-date;
 $date.ToString('o');
  [ENTER]
 
 Can you?

Actually, it is like this:

C:\work powershell -Sta -NoProfile -NonInteractive -Command $date = get-date;
$date.ToString('o');
 [ENTER]

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


[Issue 7918] Crash when using heredoc syntax in DMD v2.05[89] on Win7 [64bit]

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7918


Dejan Lekic dejan.le...@gmail.com changed:

   What|Removed |Added

 CC||dejan.le...@gmail.com


--- Comment #1 from Dejan Lekic dejan.le...@gmail.com 2012-04-20 05:55:39 PDT 
---
Can you do something like this on Windows 7:

C:\work powershell -Sta -NoProfile -NonInteractive -Command 
$date = get-date;
$date.ToString('o');
 [ENTER]

Can you?

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


[Issue 7247] All programs segfault before main

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7247


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

   Severity|blocker |trivial


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


[Issue 7362] forward referenced inner struct with align(1) doesn't add to offset of next field when used inside a union of another struct, that is nested in the same outer struct

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7362


Marco Leise marco.le...@gmx.de changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |2.059


--- Comment #2 from Marco Leise marco.le...@gmx.de 2012-04-20 08:55:45 PDT ---
Yes, it has been fixed in the mean time. Add this to the solved bugs for 2.059!

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


[Issue 4843] Inconsistency in overloading ref vs. non-ref

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4843


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #4 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 09:10:43 
PDT ---
Compiles on 2.059 Win32

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


[Issue 4983] Stack overflow while initializing struct member with address of one of its methods

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4983


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com
   Severity|normal  |minor


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 09:14:07 
PDT ---
This is a recursive definition, I guess this should be expected. Lowering to
minor issue.

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


[Issue 7637] writeln doesn't take custom toString into account

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7637


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #4 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-04-20 
09:19:13 PDT ---
Ok fair enough.

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


[Issue 5469] Limitation when instantiating templates in the context of a function

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5469


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #5 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 09:30:13 
PDT ---
On 2.059 Win32, I get a similar result as in comment 2

PS E:\DigitalMars\dmd2\samples rdmd -w bug.d
Internal error: toir.c 178

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


[Issue 5634] ICE(machobj.c) on Mac OS X when there are multiple 'main's

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5634


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 09:36:27 
PDT ---
Duplicate of issue 7647

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


[Issue 7647] ICE(machobj.c) with two main() functions

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7647


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 Depends on||5634


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 09:37:09 
PDT ---
Dupl

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


[Issue 4958] Floating point enums should check for total loss of precision

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4958


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #3 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 09:50:01 
PDT ---
2.059 Win32

PS E:\DigitalMars\dmd2\samples rdmd -w --main bug.d
bug.d(3): Error: enum bug.FloatEnum enum member B has inexact value, due to
loss of precision
bug.d(3): Error: enum bug.FloatEnum enum member C has inexact value, due to
loss of precision
PS E:\DigitalMars\dmd2\samples

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


[Issue 5754] ICE(glue.c): using nested delegate literal as template alias parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5754


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #4 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 10:15:31 
PDT ---
Compiles and runs with 2.059 Win32

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


[Issue 4958] Floating point enums should check for total loss of precision

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4958


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

   What|Removed |Added

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


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


[Issue 5754] ICE(glue.c): using nested delegate literal as template alias parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5754



--- Comment #5 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 10:17:15 
PDT ---
I don't have the D1 compiler installed but it would be worth trying if issue
2962 is resolved as well.

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


[Issue 7950] New: Cannot derive interface from empty type tuple

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7950

   Summary: Cannot derive interface from empty type tuple
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: samu...@voliacable.com


--- Comment #0 from Max Samukha samu...@voliacable.com 2012-04-20 10:31:13 
PDT ---
Empty tuple in an interface's base type list should be legal as it is with
classes.

import std.typetuple;

interface I {} // ok
interface I2 : TypeTuple!() {} // ok
interface I3 : TypeTuple!(I) {} // ok
class A : I, TypeTuple!() {} // ok
interface I4 : I, TypeTuple!() {} // fail

Error: interface a.I4 base type must be interface, not ()

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


[Issue 7950] Type tuples are incorrectly flattened in base type list of interface

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7950


Max Samukha samu...@voliacable.com changed:

   What|Removed |Added

Summary|Cannot derive interface |Type tuples are incorrectly
   |from empty type tuple   |flattened in base type list
   ||of interface


--- Comment #1 from Max Samukha samu...@voliacable.com 2012-04-20 10:50:16 
PDT ---
Actually, the problem is with tuple flattening in general:

class A2 : I, TypeTuple!(I2) {} // ok
interface I5 : I, TypeTuple!(I2) {} // fail

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


[Issue 7951] New: DMD: Internal error: backend/cgxmm.c 567

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7951

   Summary: DMD: Internal error: backend/cgxmm.c 567
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: suicide...@xited.de


--- Comment #0 from Zoadian suicide...@xited.de 2012-04-20 11:26:25 PDT ---
DMD 2.059 exits compilation with
tym = x1d
Internal error: backend/cgxmm.c 567

Code:


import std.stdio;
import std.math;
import core.simd;
import std.datetime;

T[D] simdAdd(T, int D)(T[D] a1, T[D] a2) {
T[D] res;
float4 v1;
float4 v2;
v1.array = a1;
v2.array = a2;
float4 r;

string gen() {
string s;
foreach(i;0..D)
{
s ~= ;
}
return s;
}
//foreach(i;0..10)
//r = v1+v2;//__simd(XMM.ADDPS, v1,v2);
return cast(float[4])(v1+v2);
}

T[D] addV(T, int D)(T[D] a1, T[D] a2) {
T[D] r;
//foreach(x;0..10)
foreach(i;0..D)
r[i] = a1[i]+a2[i];
return r;
}


void main()
{
float[4] v1 = [1,2,3,4];
float[4] v2 = [1,2,3,4];
void test1(){addV(v1,v2);}
void test2(){simdAdd(v1,v2);}


//~ writeln(STD: ,
benchmark!(addS!(int,4)([1,2,3,4],[1,2,3,4]))(10_000_000));
writeln(_VEC: , benchmark!(test1)(10_000_000));
writeln(SIMD: , benchmark!(test2)(10_000_000));
}

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


[Issue 7897] Problem with alias template parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7897


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2012-04-20 
11:44:45 PDT ---
==
// register function in struct (doesn't work, won't take alias for some
reason?)
HookupEngineFunction!( d.outputDebug )( pImports );
==

This is failing to compile because outputDebug is a non-static member function
of struct Debug. This means that a 'this' pointer is required. The parameter
'alias funcptr' to HookupEngineFunction requires an argument that is a symbolic
alias. But you're supplying a runtime value, d.outputDebug, that cannot be
evaluated at compile time.

In other words, d.outputDebug would be a delegate, and delegates can only be
constructed at runtime because they consist of a pair: a 'this' pointer and the
address of the function. The 'this' pointer cannot be determined at compile
time.

If you make Debug.outputDebug a static member function, it will compile.

This is not a compiler bug.

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


[Issue 7647] ICE(machobj.c) with two main() functions

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7647


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution||DUPLICATE


--- Comment #2 from Dmitry Olshansky dmitry.o...@gmail.com 2012-04-20 
11:49:40 PDT ---
Then mark it as such.

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

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


[Issue 5634] ICE(machobj.c) on Mac OS X when there are multiple 'main's

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5634


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 CC||christian.koest...@gmail.co
   ||m


--- Comment #2 from Dmitry Olshansky dmitry.o...@gmail.com 2012-04-20 
11:49:40 PDT ---
*** Issue 7647 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 4983] Stack overflow while initializing struct member with address of one of its methods

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4983


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 CC||dmitry.o...@gmail.com
   Severity|minor   |normal


--- Comment #2 from Dmitry Olshansky dmitry.o...@gmail.com 2012-04-20 
11:51:17 PDT ---
Compier stackoverflows and segfaults are NOT minor issue.

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


[Issue 7453] Can't return value from within opApply

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7453



--- Comment #3 from github-bugzi...@puremagic.com 2012-04-20 12:04:41 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4d28102c7a20341db6239bd843f406d6a5a45725
fix Issue 7453 - Can't return value from within opApply

Inside main function, and after first semantic, ReturnStatement::exp is
filled with IntegerExp(0). Then in second semantic, implicit0 doesn't
become 1, and error occurs.

ReturnStatement object should keep implicit0 value for repeating
call of semantic().

https://github.com/D-Programming-Language/dmd/commit/03e8c2656d03c90cd2bda72abb8b6392556f1017
Merge pull request #892 from 9rnsr/fix7453

Issue 7453 - Can't return value from within opApply

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


[Issue 7952] New: invalid dwarf2 offset when trying to debug with gdb

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7952

   Summary: invalid dwarf2 offset when trying to debug with gdb
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Mac OS X
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ernstmart...@gmail.com


--- Comment #0 from Martin Jacobsson ernstmart...@gmail.com 2012-04-20 
12:01:31 PDT ---
I've tried to debug a simple hello world program with gdb 7.4 on os x.
The program is built with  -gc -debug -m64 

(gdb) list
invalid dwarf2 offset 1594098948


When running the same executable in lldb I can list the source code when
setting a breakpoint, but
no frame variables are showing (a separate issue).

/Martin

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


[Issue 7953] New: DMD Error: variable r used before set when compiling with -O

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7953

   Summary: DMD Error: variable r used before set when compiling
with -O
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: suicide...@xited.de


--- Comment #0 from Zoadian suicide...@xited.de 2012-04-20 12:30:21 PDT ---
When compiling this code with dmd -O it says:
test.d(55) Error: variable r used before set
i might have overlooked something, but shouldn't that compile?
dmd 2.059 here.


import std.stdio;
import std.math;
import core.simd;
import std.datetime;
import std.conv;

/**
Benchmarks:


suicide@zoaHTPC /media/code $ dmd test.d
_VEC: [TickDuration(2014413920)]
SIMD: [TickDuration(2057610817)]
suicide@zoaHTPC /media/code $ dmd test.d -O
_VEC: [TickDuration(1589025986)]
SIMD: [TickDuration(2050198165)]
suicide@zoaHTPC /media/code $ dmd test.d -O -release
_VEC: [TickDuration(1738538836)]
SIMD: [TickDuration(1172608340)]
suicide@zoaHTPC /media/code $ dmd test.d -O -release -inline
_VEC: [TickDuration(1570424587)]
SIMD: [TickDuration(1184942170)]
suicide@zoaHTPC /media/code $ dmd test.d -O -release -noboundscheck
_VEC: [TickDuration(752330929)]
SIMD: [TickDuration(1128528117)]

*/


 string gen(int D) {
string s;
for(size_t i = 0; i  D-1; i+=4)
{
s ~= v1.array = a1[~to!string(i)~..~to!string(i+4)~];;
s ~= v2.array = a2[~to!string(i)~..~to!string(i+4)~];;
s ~= r = __simd(XMM.ADDPS, v1,v2);;


//~ s ~= res[~to!string(i)~..~to!string(i+4)~] = r.array;;
s ~= res.ptr[~to!string(i)~] = r.ptr[~to!string(i)~];;
s ~= res.ptr[~to!string(i+1)~] = r.ptr[~to!string(i+1)~];;
s ~= res.ptr[~to!string(i+2)~] = r.ptr[~to!string(i+2)~];;
s ~= res.ptr[~to!string(i+3)~] = r.ptr[~to!string(i+3)~];;
}
return s;
}

T[D] simdAdd(T, int D)(T[D] a1, T[D] a2) {
T[D] res;
float4 v1;
float4 v2;
float4 r;

   //writeln(gen(D));
mixin(gen(D));
return res;
}

T[D] addV(T, int D)(T[D] a1, T[D] a2) {
T[D] r;
//foreach(x;0..10)
foreach(i;0..D)
r[i] = a1[i]+a2[i];
return r;
}


void main()
{
float[8] v1 = [1,2,3,4,1,2,3,4];
float[8] v2 = [1,2,3,4,1,2,3,4];
void test1(){addV(v1,v2);}
void test2(){simdAdd(v1,v2);}

   // test2();
//~ writeln(STD: ,
benchmark!(addS!(int,4)([1,2,3,4],[1,2,3,4]))(10_000_000));
writeln(_VEC: , benchmark!(test1)(10_000_000));
writeln(SIMD: , benchmark!(test2)(10_000_000));
}

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


[Issue 7953] DMD Error: variable r used before set when compiling with -O

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7953



--- Comment #1 from Zoadian suicide...@xited.de 2012-04-20 12:32:53 PDT ---
first one:
suicide@zoaHTPC /media/code $ dmd test.d -release -noboundscheck -O
test.d(55): Error: variable r used before set


another one:
suicide@zoaHTPC /media/code $ dmd test.d -release -noboundscheck -O -inline
/usr/include/phobos2/std/datetime.d(29600): Error: variable std.path.sep is
depr
ecated
/usr/include/phobos2/std/datetime.d(29601): Error: variable std.path.sep is
depr
ecated
/usr/include/phobos2/std/path.d(2715): Error: alias std.path.onOutOfMemoryError
is deprecated

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


[Issue 7897] Problem with alias template parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7897



--- Comment #3 from Manu turkey...@gmail.com 2012-04-20 12:50:03 PDT ---
Actually no, I'm not trying to do pointer to member type stuff.

As I saw it, this is just a single function pointer (surely that is strictly
defined by the 'function' keyword?) in a struct.

I'm addressing a static (well, __gshared) instance, 'd'.
Shouldn't d be a singular instance, allocated in the data block, and thereby
accessible at compile time? I figure this should effectively be no different
than a __gshared void*.

Have I misunderstood something rather fundamental about __gshared? This should
make it effectively identical to a C global right? Ie, singular instance,
allocated in the data block, and address known at compile time.
Under that assumption, there's no technical reason the compiler shouldn't be
able to alias that variable at compile time and generate appropriate code.

If I'm mistaken about that, how do I produce a variable effectively identical
to a C global?

Like I say, this is a very boiled down case, and infact, this particular case
is no longer directly relevant in my code, but the same scenario is coming up
frequently. That is, I have a global instance of a structure, which I expect
should be accessible at compile time...

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


[Issue 7453] Can't return value from within opApply

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7453


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

   What|Removed |Added

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


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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #13 from bearophile_h...@eml.cc 2012-04-20 14:41:35 PDT ---
This seems another example of the same problem:


import std.stdio: writeln;
import std.conv: text;
struct Foo {}
void main() {
Foo* f = new Foo;
writeln(f);
writeln(text(f));
}


Output:

15D2FD0
22884304

Expected output:

15D2FD0
15D2FD0

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #14 from bearophile_h...@eml.cc 2012-04-20 14:49:05 PDT ---
I've taken a look here:
https://github.com/D-Programming-Language/phobos/pull/231

Kenji Hara sasy:

The same name with core.stdc.sprintf is very confusing. And std.string.format 
returns new string, but core.stdc.sprintf write the formatted string into 
specified buffer. The two behaviors are quite different.


Andrei Alexandrescu says:

There's no problem with core.stdc.sprintf bearing the same name as 
std.format.sprintf. Phobos has had such duplicate names for years without a 
problem.


I agree that Phobos has some name clashes. But I don't agree it's a good thing.
It should be avoided if possible for newly added names.
And I agree the behavior of the new functions is different from the C
functions. So I agree with Kenji Hara, they should have different names.

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


[Issue 6240] ICE(toctype.c) [GSoC]: with template mixin

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6240


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #2 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 15:03:51 
PDT ---
Can't reproduce on 2.059 Win32 either.

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


[Issue 6327] Internal error: ..\ztc\cgcv.c 206

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6327


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #5 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 15:27:33 
PDT ---
There is no way to reproduce this one, and the guy won't answer, 9 months after
having opened it. This should probably be closed.

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


[Issue 6332] Auto-return function cannot be inferred as @safe

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6332


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #3 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 15:42:30 
PDT ---
Compiles with 2.059 on Win32.

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


[Issue 6358] Segfault when using an member template (not a template instance) in an expression.

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6358


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 15:51:22 
PDT ---
The test case doesn't compile on 2.059 Win32, but doesn't crash.

PS E:\DigitalMars\dmd2\samples rdmd -w --main bug.d
bug.d(8): Error: cannot resolve type for s.peek(T)
bug.d(8): Error: incompatible types for ((s.peek(T)) is ( s)): '_error_' and
'S6358*'
bug.d(12): Error: cannot resolve type for s.peek(T)
bug.d(12): Error: incompatible types for ((s.peek(T)) + ( s)): '_error_' and
'S6358*'
bug.d(16): Error: cannot resolve type for s.peek(T)
PS E:\DigitalMars\dmd2\samples

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


[Issue 6458] Multibyte char literals shouldn't implicitly convert to char

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6458


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #13 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 16:01:13 
PDT ---
This doesn't compile on 2.059 Win32.

PS E:\DigitalMars\dmd2\samples rdmd -w bug.d
bug.d(4): invalid UTF-8 sequence
bug.d(5): invalid UTF-8 sequence
PS E:\DigitalMars\dmd2\samples

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


[Issue 6469] Compiler fails to initialize associative array: string-[string-string]

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6469



--- Comment #3 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 16:03:35 
PDT ---
Also fails on 2.059 Win32.

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


[Issue 6475] template identifier is not a member of alias

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6475


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com
   Platform|Other   |All
 OS/Version|Linux   |All


--- Comment #3 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 16:05:06 
PDT ---
Also fails on 2.059 Win32

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


[Issue 7897] Problem with alias template parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7897


Manu turkey...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |


--- Comment #4 from Manu turkey...@gmail.com 2012-04-20 16:14:55 PDT ---
Here, I've simplified it some more. This is functionally identical to the first
example, I just rephrased it to 'int' to remove any confusion about function
pointers and intent.


// member contained in a struct
struct Thing
{
int x;
}

Thing thing; // this is effectively identical to declaring 'int x;' globally,
it's just wrapped in a thin struct

int x; // i'll also do it directly, to prove it works.

void main()
{
// these 3 statements should be effectively identical
thing.x = 10;   // this works, obviously
AliasTheStruct!( thing )(); // this works
AliasTheInt!( thing.x )();  // this is the problem

AliasTheInt!( x )();// of course, this works fine
}

void AliasTheStruct( alias a )()
{
a.x = 10;
}

void AliasTheInt( alias a )()
{
a = 10;
}

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


[Issue 6723] foreach (i, e; range) {} crash

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6723


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-04-20 
16:40:26 PDT ---
Fixed. This used to crash but it doesn't anymore, now it's a compiler error (as
it should be, there is no 'index' in input ranges).

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


[Issue 6794] ICE(expression.c): with inout

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6794


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 16:43:30 
PDT ---
Compiles and runs fine on 2.059 Win32

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


[Issue 7897] Problem with alias template parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7897



--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2012-04-20 
16:43:49 PDT ---
(In reply to comment #3)
 As I saw it, this is just a single function pointer (surely that is strictly
 defined by the 'function' keyword?) in a struct.

It isn't a function pointer. Non-static member methods are never a simple
function pointer, they always require a 'this' pointer as well, as they are
delegates. This is not like C++ member function pointers.

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


[Issue 7897] Problem with alias template parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7897


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

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||INVALID


--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2012-04-20 
16:49:40 PDT ---
 AliasTheInt!( thing.x )();  // this is the problem

Right. It's a problem because thing.x is being passed as an *alias* parameter.
An alias must be symbol, not a computation on a symbol. thing.x is semantically
equivalent to:

   *(thing + x.offsetof)

which is not a symbol.

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


[Issue 6834] std.stdio conflicts with core.stdc.stdio

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6834


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 OS/Version|Linux   |All
   Severity|normal  |trivial


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


[Issue 6838] Covariant return types don't work with static arrays

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6838


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 17:00:57 
PDT ---
This no longer compiles on 2.059 Win32:

PS E:\DigitalMars\dmd2\samples rdmd bug.d
bug.d(6): Error: function bug.Bar.test of type int[2u]() overrides but is not
covariant with bug.Foo.test of type int[]()
Failed: dmd -v -o- bug.d -I.
PS E:\DigitalMars\dmd2\samples

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


[Issue 6848] typeof(super) does not take into account const/immutable attributes inside member functions

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6848


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #1 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 17:03:12 
PDT ---
Output of 2.059 Win32

PS E:\DigitalMars\dmd2\samples rdmd --main bug.d
immutable(Bar)
immutable(Bar)
immutable(Foo)
immutable(Foo)
PS E:\DigitalMars\dmd2\samples

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


[Issue 6892] Formatted write with specified length of enum member

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6892


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #5 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 17:12:03 
PDT ---
On 2.059 Win32, the original test passes but the test of comment 1 throws an
exception:

PS E:\DigitalMars\dmd2\samples rdmd bug.d
e0
0
0
std.format.FormatException@E:\DigitalMars\dmd2\windows\bin\..\..\src\phobos\std\format.d(1178):
integral

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


[Issue 6896] ICE(glue.c !vthis-csym): on method with alias this access

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6896


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #3 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 17:15:45 
PDT ---
Both tests pass and run with or without -inline

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


[Issue 6896] ICE(glue.c !vthis-csym): on method with alias this access

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6896



--- Comment #4 from SomeDude lovelyd...@mailmetrash.com 2012-04-20 17:16:10 
PDT ---
(In reply to comment #3)
 Both tests pass and run with or without -inline

On 2.059 Win32

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


[Issue 7897] Problem with alias template parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7897



--- Comment #7 from Manu turkey...@gmail.com 2012-04-20 17:16:54 PDT ---
(In reply to comment #5)
 (In reply to comment #3)
  As I saw it, this is just a single function pointer (surely that is strictly
  defined by the 'function' keyword?) in a struct.
 
 It isn't a function pointer. Non-static member methods are never a simple
 function pointer, they always require a 'this' pointer as well, as they are
 delegates. This is not like C++ member function pointers.

extern(C) void function( const char* format, ... ) outputDebug; - this is a
function pointer. It's not a method, or a delegate. I have no idea why you're
introducing methods and delegates into the conversation. But it doesn't matter,
it's irrelevant to the problem here...


  AliasTheInt!( thing.x )();  // this is the problem
 
 Right. It's a problem because thing.x is being passed as an *alias* parameter.
 An alias must be symbol, not a computation on a symbol. thing.x is 
 semantically
 equivalent to:
 
*(thing + x.offsetof)
 
 which is not a symbol.

Oooohkay, so now we get to the bottom of it.
Right, well I didn't realise that restriction. I just assumed any statically
addressable variable was alias-able.

So this is a feature request then, not a bug.
There's still technically no reason it shouldn't work, it's just not quite how
alias is written?
How much trouble would it be to extend 'alias' to include an offset value?

This restriction makes it very difficult to drill down into structures via
recursive enumeration. The workaround I've had to use is to use strings instead
of aliases that can mixin an absolute reference, but it's really untidy, and
again, messes with the editor a lot (syntax hilighting, auto-complete, etc).
It also requires mixin(a) everywhere, and there are lots of cases where mixin()
is invalid in the middle of an expression. This requires a further workaround
to build the whole expression into a string and mix the whole thing in.

I wonder if you could use lowering here to produce the same result via lowered
mixin? Although it sounds much cleaner to simply add an offset to aliases.

Another alternative could be to just invent the appropriate symbol when a
reference like this appears. Symbol names follow the d scoping patterns right?
In this case, the symbol would just be my.module.thing.x (or with whatever
mangling happens to appear in D symbols).

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


[Issue 6834] std.stdio conflicts with core.stdc.stdio

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6834



--- Comment #4 from hst...@quickfur.ath.cx 2012-04-20 17:28:24 PDT ---
Can't wait for the new std.io to get into phobos, then all of this will be a
non-issue.

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


[Issue 7955] New: Nested function error in sort with lambda template but not with a lambda

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7955

   Summary: Nested function error in sort with lambda template but
not with a lambda
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-04-20 17:52:05 PDT ---
import std.algorithm: sort;
int foo(int n)() {
sort!((a, b) = true)([1]);
//sort!((int a, int b) = true)([1]);
foo!1();
return 0;
}
void main() {
foo!0();
}



DMD 2.059 shows:

...\dmd2\src\phobos\std\algorithm.d(6781): Error: function
test.foo!(0).foo.sort!(__lambda3,cast(SwapStrategy)0,int[]).sort is a nested
function and cannot be accessed from test.foo!(1).foo

The version that uses the lambda instead of a lambda template compiles
correctly (then crashes at a runtime because the sort function is stupid).

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


[Issue 5113] stray e2ir: in casting error message

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5113



--- Comment #2 from bearophile_h...@eml.cc 2012-04-20 17:53:19 PDT ---
Similar case:


int main() {
float[1] a;
return cast(int)a;
}


test2.d(3): Error: e2ir: cannot cast a of type float[1u] to type int

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


[Issue 7956] New: Missing error line number with wrong function name

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7956

   Summary: Missing error line number with wrong function name
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-04-20 17:55:02 PDT ---
Wrong D2 code:


import std.stdio;
void main() {
open(foo);
}


DMD 2.060alpha shows:

test.d: Error: module test std.stdio.fopen is private
test.d(3): Error: undefined identifier open, did you mean function fopen?

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


[Issue 7897] Problem with alias template parameter

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7897



--- Comment #8 from Walter Bright bugzi...@digitalmars.com 2012-04-20 
18:00:42 PDT ---
(In reply to comment #7)
 Oooohkay, so now we get to the bottom of it.
 Right, well I didn't realise that restriction. I just assumed any statically
 addressable variable was alias-able.

Any *symbol* is aliasable. It isn't about addresses.


 So this is a feature request then, not a bug.
 There's still technically no reason it shouldn't work, it's just not quite how
 alias is written?
 How much trouble would it be to extend 'alias' to include an offset value?

This is a significant redesign of what alias is.


 This restriction makes it very difficult to drill down into structures via
 recursive enumeration. The workaround I've had to use is to use strings 
 instead
 of aliases that can mixin an absolute reference, but it's really untidy, and
 again, messes with the editor a lot (syntax hilighting, auto-complete, etc).
 It also requires mixin(a) everywhere, and there are lots of cases where 
 mixin()
 is invalid in the middle of an expression. This requires a further workaround
 to build the whole expression into a string and mix the whole thing in.
 
 I wonder if you could use lowering here to produce the same result via lowered
 mixin? Although it sounds much cleaner to simply add an offset to aliases.

It isn't simple, because having an offset makes it an expression, not a symbol.
It's a substantial redesign.


 Another alternative could be to just invent the appropriate symbol when a
 reference like this appears. Symbol names follow the d scoping patterns right?
 In this case, the symbol would just be my.module.thing.x (or with whatever
 mangling happens to appear in D symbols).

Can't you just pass a pointer around?

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


[Issue 7957] New: std.functional untuple/untupleReversed too

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7957

   Summary: std.functional untuple/untupleReversed too
   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 2012-04-20 18:08:34 PDT ---
I suggest two functions like this in Phobos. Maybe a more correct name for them
is apply/applyReversed, but apply() is probably meant to be more flexible.

The purpose of untuple is to apply the items of a tuple as arguments to a
function, inside map/filter. So instead of this:
t = foo2(t.tupleof)

You write a less complex:
untuple!foo2

Python has the itertools.starmap function to perform a lazy map with untuple
(apply) too, but it lacks a starfilter:
http://docs.python.org/library/itertools.html#itertools.starmap

untupleReversed does a little more, because it also reverses the tuple items
before feeding them to the foo2 function. This is often useful for 2-tuples,
it's related to (but not the same as) the flip function used in Haskell:

-- | @'flip' f@ takes its (first) two arguments in the reverse order of @f@.
flip:: (a - b - c) - b - a - c
flip f x y  =  f y x

It's an adapter between a range of tuples and an already written function
that takes flipped or reversed arguments.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

import std.algorithm, std.range, std.stdio, std.functional,
   std.typecons, std.traits;

// To apply a given callable to a Tuple (alternative name: apply).
template untuple(alias callable) {
auto untuple(Tup)(Tup t)
if (isTuple!Tup  ParameterTypeTuple!callable.length == Tup.length) {
return callable(t.tupleof);
}
}

void main() {
auto a1 = abcdd;
auto a2 = [10, 20, 30, 40];
auto a3 = [100, 200, 300, 400];

static int foo2(dchar a, int b) { return a + b; }
zip(a1, a2).map!(t = foo2(t.tupleof))().writeln();

zip(a1, a2).map!(untuple!foo2)().writeln();

static int foo3(dchar a, int b, int c) { return a + b + c; }
zip(a1, a2, a3).map!(untuple!foo3)().writeln();
}


Output:

[107, 118, 129, 140]
[107, 118, 129, 140]
[207, 318, 429, 540]

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

One version that also reverses the tuple items:


import std.algorithm, std.range, std.stdio, std.typecons, std.traits,
   std.typetuple, std.string, std.conv;

// _genIndexes(foo, 3) == foo[2], foo[1], foo[0]
private string _genIndexes(string name, size_t start) {
string[] result;
for (int i = start - 1; i = 0; i--)
result ~= name ~ [ ~ text(i) ~ ];
return result.join(, );
}

// To apply a given callable to a Tuple (alternative name: apply),
// but flipping the tuple items.
template untupleReversed(alias callable) {
auto untupleReversed(Tup)(Tup t)
if (isTuple!Tup  ParameterTypeTuple!callable.length == Tup.length) {
mixin(return callable( ~ _genIndexes(t, Tup.length) ~ ););
}
}

void main() {
auto pairs = zip([10, 20, 30, 40], [100, 200, 300, 400]);
static int div2(int a, int b) { return a / b; }

pairs.map!(t = div2(t[1], t[0]))().writeln();
pairs.map!(untupleReversed!div2)().writeln();
}


Output:

[10, 10, 10, 10]
[10, 10, 10, 10]

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


[Issue 6892] Formatted write with specified length of enum member

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6892



--- Comment #6 from Ali Cehreli acehr...@yahoo.com 2012-04-20 18:55:09 PDT ---
The problem at comment 5 can be reduced to this:

import std.stdio;

void main()
{
writefln(%f, 42); // COMPILATION ERROR
}

It looks like an integral cannot be matched to a floating point format
specifier. (The same problem with %g, etc.)

I have mixed feelings about this. Although 42 is definitely not a floating
point type, it is implicitly converted to one according to language rules.

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


  1   2   >