[Issue 1985] import expression should return ubyte[] not string

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1985


d...@dawgfoto.de changed:

   What|Removed |Added

 CC||d...@dawgfoto.de
   Platform|x86 |All
Version|1.028   |D1  D2
 OS/Version|Windows |All


--- Comment #9 from d...@dawgfoto.de 2012-05-27 03:16:35 PDT ---
UTF validation and conversions can be done at compile time,
although the interpreter is currently a little slow for this.

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


[Issue 3536] [patch] Make switch case error at unintentional fallthrough. (allow intentional fallthrough)

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3536



--- Comment #10 from bearophile_h...@eml.cc 2012-05-27 05:44:10 PDT ---
Is it possible to close this bug now?

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


[Issue 8154] New: Source fo error is hidden when using default-parametrized tempalte-struct

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8154

   Summary: Source fo error is hidden when using
default-parametrized tempalte-struct
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dmitry.o...@gmail.com


--- Comment #0 from Dmitry Olshansky dmitry.o...@gmail.com 2012-05-27 
05:50:12 PDT ---
struct Policy{}

struct Bogus(CT=Policy)
{
this(int dummy)
{
_r = 1;
}
}

Bogus a;

void main(){}


dmd from git commit 54056a901cd78410b96cb9bff245c231e6d6f71e outputs:

bug3.d(11): Error: struct bug3.Bogus(CT = Policy) is used as a type

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


[Issue 6921] Request for a 'static final switch' statement

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6921


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2012-05-27 05:54:55 PDT ---
Do you mean something like this? It's handy:


enum Options {
Some, Many, All
}

class OptionManager(Options opt) {
static final switch(opt) {
case Options.Some:
alias TypeTuple!(int) TP;
break;
case Options.Many:
alias TypeTuple!(int, int, int) TP;
break;
case Options.All:
alias TypeTuple!(int, int, int, int, int, int) TP;
break;
}

public this(TP params) {
// ...
}
}

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


[Issue 8154] Source of error is hidden when using default-parametrized tempalte-struct

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8154


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

   What|Removed |Added

   Keywords||diagnostic
Summary|Source fo error is hidden   |Source of error is hidden
   |when using  |when using
   |default-parametrized|default-parametrized
   |tempalte-struct |tempalte-struct


--- Comment #1 from Dmitry Olshansky dmitry.o...@gmail.com 2012-05-27 
05:52:04 PDT ---
the real problem is seen if replaced with:

Bogus!Policy a;

bug3.d(7): Error: undefined identifier _r, did you mean variable a?

That's what I'd expect with default instantation too.

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


[Issue 3536] [patch] Make switch case error at unintentional fallthrough. (allow intentional fallthrough)

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3536


Chad Joan chadj...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX


--- Comment #11 from Chad Joan chadj...@gmail.com 2012-05-27 06:08:33 PDT ---
Yes, it can be closed.  Here ya go.

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


[Issue 4997] names, values, length and basetype enum properties

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4997



--- Comment #3 from bearophile_h...@eml.cc 2012-05-27 10:56:27 PDT ---
Two other useful properties are succ and pred, to be used similarly to:

enum MyEnum : ushort {
FOO  = 10,
BAR  = 20,
BAZ  = 40,
SPAM = 30
}

static assert(MyEnum.BAR.meta.succ == MyEnum.BAZ);
static assert(MyEnum.BAR.meta.pred == MyEnum.FOO);

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


[Issue 3536] [patch] Make switch case error at unintentional fallthrough. (allow intentional fallthrough)

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3536


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #12 from Walter Bright bugzi...@digitalmars.com 2012-05-27 
13:47:13 PDT ---
(In reply to comment #11)
 Yes, it can be closed.  Here ya go.

I do appreciate the effort you put into this (especially since you've gone the
distance with test cases and documentation), and am sorry that it hasn't caught
interest.

One of the most difficult parts of my job with D is to say no, and sometimes I
feel like Doctor No. I know how hard it is on contributors like you.

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


[Issue 8155] New: Deprecate std.range.lockstep

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8155

   Summary: Deprecate std.range.lockstep
   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-05-27 14:20:51 PDT ---
I suggest to deprecate std.range.lockstep because with the recent improvements
in tuple unpacking, std.range.zip is able to replace its the main purpose, this
now works:

import std.stdio, std.range;
void main() {
foreach (a, b; zip([1,2], [red, blue]))
writeln(a,  , b);
}


lockstep() is also able to iterate with an index variable, zip() is not able to
do it:

import std.stdio, std.range;
void main() {
foreach (i, a, b; lockstep([1,2], [red, blue]))
writeln(i,  , a,  , b);
}


But from my experience the need of an indexing variable on a zipped iteraton is
not so common, and the there are other solutions, like:

import std.stdio, std.range;
void main() {
foreach (i, a, b; lockstep(iota([1,2].length), [1,2], [red, blue]))
writeln(i,  , a,  , b);
}


A better solution (hopefully not too much slower) is to use enumerate(zip()),
as in Python and Haskell, see Issue 5550 :


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

struct Enumerate(R) {
R r;
int i;

@property bool empty() {
return this.r.empty;
}

@property Tuple!(typeof(this.i), typeof(R.init.front)) front() {
return typeof(return)(i, this.r.front);
}

void popFront() {
this.r.popFront();
this.i++;
}
}

Enumerate!R enumerate(R)(R range, int start=0) if (isInputRange!R) {
return Enumerate!R(range, start);
}

void main() {
foreach (i, a, b; enumerate(zip([1,2], [red, blue])))
writeln(i,  , a,  , b);
}



Or even use countFrom (similar to Python itertools.count()), see Issue 7839 :

import std.stdio, std.range;

struct CountFrom(T) {
T n;
this(T n_) { this.n = n_; }
const bool empty = false;
@property T front() { return n; }
void popFront() { /* n++; */ n += 1; }
}

CountFrom!T countFrom(T)(T start) { return CountFrom!T(start); }
CountFrom!T countFrom(T)() { return CountFrom!T(cast(T)0); }

void main() {
foreach (i, a, b; zip(countFrom!size_t(), [1,2], [red, blue]))
writeln(i,  , a,  , b);
}


(For Phobos there are much more commonly useful functions, like amap/afilter
that mean array(map()) and array(filter()) that are useful everywhere and
shorten/simplify the code).

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


[Issue 6036] Constructor, static opCall and object opCall

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6036



--- Comment #7 from bearophile_h...@eml.cc 2012-05-27 18:14:48 PDT ---
See also Issue 4678  and Issue 7210 and Issue 1840

This is a problem I hit often.

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


[Issue 7982] iota broken when start and end are unsigned and step is negative.

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7982



--- Comment #2 from github-bugzi...@puremagic.com 2012-05-27 19:50:06 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/ebcba68f7bddbf66aa845bc956607aaa84994b82
fix Issue 7982 - unsigned reverse iota broken

iota.length needs to take into account unsigned values when the end is greater
than the start.

https://github.com/D-Programming-Language/phobos/commit/613d10f1b29a7a1c4a5abf97982ca0c9d59df045
Merge pull request #566 from eco/unsigned-reverse-iota

fix Issue 7982 - unsigned reverse iota broken

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


[Issue 7824] isInputRange fails to recognize inout(T)[]

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7824



--- Comment #2 from github-bugzi...@puremagic.com 2012-05-27 19:56:08 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/ed00f6c28c602bd5c3b197e555c44d3b53ef76ba
fix Issue 7824 - isInputRange fails to recognize inout(T)[]

https://github.com/D-Programming-Language/phobos/commit/1c33f47992894fb53c9e0a3941b8780b9141c0e2
Merge pull request #539 from 9rnsr/fix7824

Issue 7824 - isInputRange fails to recognize inout(T)[]

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


[Issue 8112] std.algorithm.fill must accept InputRange

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8112



--- Comment #2 from github-bugzi...@puremagic.com 2012-05-27 20:35:14 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/e9dd66f8a0da1f4987a366f1a194b983c45c4b72
Issue 8112 - std.algorithm.fill accepts InputRange

https://github.com/D-Programming-Language/phobos/commit/b1e1fa658db1a277b37c32b1e4568b18c8bdf441
Merge pull request #588 from gchatelet/input_range_fill_algorithm

Issue 8112 - std.algorithm.fill must accept InputRange

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


[Issue 8156] New: Very slow compilation with string-imported file ~100 MiB

2012-05-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8156

   Summary: Very slow compilation with string-imported file ~100
MiB
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: performance
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: verylonglogin@gmail.com


--- Comment #0 from Denis Shelomovskij verylonglogin@gmail.com 2012-05-28 
09:43:05 MSD ---
dmd takes 14 s with full load of one CPU core to include 40 MiB file
as a string import on my PC. During this dmd process slowly increases its
memory using by 2-3 MiB/s.

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