[Issue 6371] Small improvements to aid auto-building DMD from git

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6371



--- Comment #2 from Nick Sabalausky  2011-07-23 
17:10:03 PDT ---
By "pre-built libs" I don't mean phobos or druntime. Just the other ones for
which the source isn't in git.

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


[Issue 6371] Small improvements to aid auto-building DMD from git

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6371



--- Comment #1 from Nick Sabalausky  2011-07-23 
17:08:56 PDT ---
Also the pre-built libs should be in version control.

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


[Issue 6371] New: Small improvements to aid auto-building DMD from git

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6371

   Summary: Small improvements to aid auto-building DMD from git
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky  2011-07-23 
16:57:59 PDT ---
- Smaller issue: sc.ini and dmd.conf should exist in version control

- Currently a big pain in the ass: In dmd's win32.mak, "CC=\dm\bin\dmc" should
be changed to "CC=dmc"

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


[Issue 596] Support array, arrayliteral and struct in switch and case

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=596



--- Comment #6 from bearophile_h...@eml.cc 2011-07-23 12:15:36 PDT ---
Regarding tuple unpacking see also issue 6365

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #14 from bearophile_h...@eml.cc 2011-07-23 12:14:23 PDT ---
See also the idea of switching on tuples, in issue 596

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #13 from bearophile_h...@eml.cc 2011-07-23 12:04:19 PDT ---
Tuple slicing and other situations create tuples with 1 items or 0 items:

auto t = tuple(1.5, "foo");
auto t1 = t[0 .. 1];
auto t2 = t[0 .. 0];

In python they are written:
(x,)  or x,
()

For the 1-tuple D may do use the same syntax (but here parentheses are
requires, while in Python they are optional):
auto (x,) = [10];
auto (y,) = t1;

What about 0-length tuples?
int[0] a;
() = a;
() = t2;

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


[Issue 6370] [RDMD] Cannot compile with etc.c.sqlite3

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6370



--- Comment #4 from Michal Minich  2011-07-23 11:08:19 
PDT ---
No prob, I should pay more attention. (is the '3' really needed, I keep
forgetting it)

Now it compiles ok, but fails to link with rdmd, I guess this is another
problem, but I suppose when dmd handles it, rdmd should too.

Command:
rdmd -L-ldl -L/usr/lib/x86_64-linux-gnu/libsqlite3.a -w -debug -g Main.d

Output:
/usr/lib/x86_64-linux-gnu/libsqlite3.a(sqlite3.o):(.rodata+0x2950): multiple
definition of `sqlite3_version'
/tmp/.rdmd/rdmd-Main.d-A0E982B2A9146FCDB47E9452DF01F7A4/Main.d.o:(.bss+0x0):
first defined here
/usr/bin/ld: Warning: size of symbol `sqlite3_version' changed from 8 in
/tmp/.rdmd/rdmd-Main.d-A0E982B2A9146FCDB47E9452DF01F7A4/Main.d.o to 6 in
/usr/lib/x86_64-linux-gnu/libsqlite3.a(sqlite3.o)
/usr/bin/ld: sqlite3_temp_directory: TLS definition in
/tmp/.rdmd/rdmd-Main.d-A0E982B2A9146FCDB47E9452DF01F7A4/Main.d.o section .tbss
mismatches non-TLS definition in
/usr/lib/x86_64-linux-gnu/libsqlite3.a(sqlite3.o) section .bss
/usr/lib/x86_64-linux-gnu/libsqlite3.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
--- errorlevel 1

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


[Issue 6370] [RDMD] Cannot compile with etc.c.sqlite3

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6370



--- Comment #3 from Dmitry Olshansky  2011-07-23 
10:56:32 PDT ---
Sorry, I've botched it, that supposed to be etc.c.sqlite3, just like you import
it

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


[Issue 6370] [RDMD] Cannot compile with etc.c.sqlite3

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6370



--- Comment #2 from Michal Minich  2011-07-23 10:50:07 
PDT ---
dmd handles it well, rdmd ends with similar error

module etc.c.sqlite from file dmd2/linux/bin64/../../src/phobos/etc/c/sqlite3.d
conflicts with another module sqlite from file
dmd2/linux/bin64/../../src/phobos/etc/c/sqlite3.d

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


[Issue 6370] [RDMD] Cannot compile with etc.c.sqlite3

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6370


Dmitry Olshansky  changed:

   What|Removed |Added

 CC||dmitry.o...@gmail.com


--- Comment #1 from Dmitry Olshansky  2011-07-23 
10:42:38 PDT ---
The root of the problem seems to be the wrong module name in etc/c/sqlite.d

Try to change it's first line to:
module etc.c.sqlite;

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


[Issue 6361] To avoid a newline in multi-line strings

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6361



--- Comment #1 from bearophile_h...@eml.cc 2011-07-23 09:12:53 PDT ---
Code by Andrej Mitrovic:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=141106

It shows better why this very small change in D language is not handy to do
with a library solution:


import std.algorithm;
import std.stdio;
import std.string;

string stripNewlines(string text)
{
auto x = text.countUntil("\n");
auto y = text.lastIndexOf("\n");

return text[x+1..y];
}

template EOS(string text)
{
enum EOS = stripNewlines(text);
}

void main()
{
writeln(EOS!"
- First item:  150
- Second item: 200
- Third item:  105
");
}

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #12 from bearophile_h...@eml.cc 2011-07-23 09:03:24 PDT ---
(In reply to comment #10)
> (In reply to comment #7)
> > (auto i, j) = tuple(1.2, "a");
> > 
> > Then the syntax can be later extended to:
> > 
> > (double i, string j) = tuple(1.2, "a");
> > 
> > Anyway, we should wait for Walter to weigh in. Thanks Kenji for this work.
> 
> How about this syntax?
> auto (i, j) = tuple(1.2, "a");
> (double, string) (i, j) = tuple(1.2, "a");

It's not ugly, but I think this looks a bit better:
(double i, string j) = tuple(1.2, "a");

Also because it's closer to (more consistent with) the currently used
definition syntax:
alias Tuple!(double,"i", string,"j") T1;
auto t1 = T1(1.2, "a");

If eventually the definition syntax too will become built-in, then you will
have something like:
alias (double i, string j) T2;
auto t2 = T2(1.2, "a");

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #11 from Kenji Hara  2011-07-23 08:33:10 PDT 
---
Oops, I forgot to paste experimental patch link.
https://github.com/9rnsr/dmd/compare/expandTuples...declarationTuple

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #10 from Kenji Hara  2011-07-23 08:28:08 PDT 
---
(In reply to comment #7)
> One simple syntactic matter is that we can't extend the existing syntax to 
> work
> with specified types. That means the user must use "auto" but cannot specify
> the types of the variables defined.
> 
> To allow that in the future, we need to move the paren before the auto:
> 
> (auto i, j) = tuple(1.2, "a");
> 
> Then the syntax can be later extended to:
> 
> (double i, string j) = tuple(1.2, "a");
> 
> Anyway, we should wait for Walter to weigh in. Thanks Kenji for this work.

How about this syntax?
auto (i, j) = tuple(1.2, "a");
(double, string) (i, j) = tuple(1.2, "a");

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


[Issue 6370] New: [RDMD] Cannot compile with etc.c.sqlite3

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6370

   Summary: [RDMD] Cannot compile with etc.c.sqlite3
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: michal.min...@gmail.com


--- Comment #0 from Michal Minich  2011-07-23 08:08:08 
PDT ---
rdmd will not compile program that imports etc.c.sqlite3 while dmd with the
same command line will.

test.d
import etc.c.sqlite3;
void main () {};

cmdline
rdmd test.d -c

Error: 
module sqlite3_bindings from file
dmd2/linux/bin64/../../src/phobos/etc/c/sqlite3.d conflicts with another module
sqlite3_bindings from file dmd2/linux/bin64/../../src/phobos/etc/c/sqlite3.d

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #9 from bearophile_h...@eml.cc 2011-07-23 07:48:46 PDT ---
(In reply to comment #8)
> Regarding mismatch in the number of elements, we may actually do good to
> disable
> 
> TypeTuple!(int, int) f = 10;
> assert(f[0] == 10);
> assert(f[1] == 10);
> 
> instead of striving to be consistent with it.

This was right my point. On this I have opened bug 6367

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #8 from Andrei Alexandrescu  2011-07-23 
07:33:33 PDT ---
Regarding mismatch in the number of elements, we may actually do good to
disable

TypeTuple!(int, int) f = 10;
assert(f[0] == 10);
assert(f[1] == 10);

instead of striving to be consistent with it.

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365


Andrei Alexandrescu  changed:

   What|Removed |Added

 CC||and...@metalanguage.com


--- Comment #7 from Andrei Alexandrescu  2011-07-23 
07:32:23 PDT ---
One simple syntactic matter is that we can't extend the existing syntax to work
with specified types. That means the user must use "auto" but cannot specify
the types of the variables defined.

To allow that in the future, we need to move the paren before the auto:

(auto i, j) = tuple(1.2, "a");

Then the syntax can be later extended to:

(double i, string j) = tuple(1.2, "a");

Anyway, we should wait for Walter to weigh in. Thanks Kenji for this work.

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


[Issue 6369] alias this doesn't work with initializer

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6369


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2011-07-23 06:10:30 PDT ---
(In reply to comment #0)
> D has tuple declaration like follows:
> 
> TypeTuple!(int, int) f = 10;
> assert(f[0] == 10);
> assert(f[1] == 10);

See bug 6367

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


[Issue 6369] New: alias this doesn't work with initializer

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6369

   Summary: alias this doesn't work with initializer
   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  2011-07-23 06:07:33 PDT ---
D has tuple declaration like follows:

TypeTuple!(int, int) f = 10;
assert(f[0] == 10);
assert(f[1] == 10);

But, alias this tuple is not expanded automatically:

TypeTuple!(int, string) f = tuple(10, "str");
assert(f[0] == 10);
assert(f[1] == "str");

And, built-in tuple also should allow on initializer:

TypeTuple!(int, string) f = TypeTuple!(10, "str");
assert(f[0] == 10);
assert(f[1] == "str");

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


[Issue 6368] New: Too many error messages for a missing );

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6368

   Summary: Too many error messages for a missing );
   Product: D
   Version: unspecified
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: minor
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-07-23 05:31:17 PDT ---
A wrong program that lacks a closing );


void main() {
foo(
}


In my opinion it generates many too many error messages, DMD 2.054:

test.d(3): expression expected, not '}'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'
test.d(4): found 'EOF' when expecting ','
test.d(4): expression expected, not 'EOF'

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


[Issue 6366] alias this doesn't work with foreach range.front

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6366


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2011-07-23 05:34:02 PDT ---
See also: http://d.puremagic.com/issues/show_bug.cgi?id=6365#c4

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #6 from Kenji Hara  2011-07-23 05:27:14 PDT ---
(In reply to comment #4)
> Optionally there is the foreach use case too. A possible syntax:
> 
> auto array = [tuple(1,"foo"), tuple(2,"bar")];
> foreach (tuple(id, name); array) {}

I filed an issue about alias this + foreach range.front behavior.
http://d.puremagic.com/issues/show_bug.cgi?id=6366
Please comment there.

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


[Issue 6367] New: Multi-assignment for typetuples is bad

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6367

   Summary: Multi-assignment for typetuples is bad
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Keywords: accepts-invalid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-07-23 05:28:42 PDT ---
This is a spinoff of issue 6365


This program compiles and runs with no errors (it doesn't assert), DMD 2.054:


import std.typetuple;
void main() {
TypeTuple!(int, int) f = 10;
assert(f[0] == 10);
assert(f[1] == 10);
}


The idea of carring this broken TypeTuple semantics over to Tuples too is icky.
I instead suggest to turn this into a compile-time error.

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


[Issue 6366] New: alias this doesn't work with foreach range.front

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6366

   Summary: alias this doesn't work with foreach range.front
   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  2011-07-23 05:24:39 PDT ---
This is similar bug2781, but different.

If range.front is alias this tuple (like std.typecons.Tuple), foreach statement
does not expand it automatically.

Example:
auto r = zip(sequence!"n", "hello");
// typeof(r.front) == Tuple!(int, char)
foreach (i, ch; r)
{
   if (i == 0) assert(ch == 'h');
   if (i == 1) assert(ch == 'e');
   if (i == 2) assert(ch == 'l');
   if (i == 3) assert(ch == 'l');
   if (i == 4) assert(ch == 'o');
}

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #5 from bearophile_h...@eml.cc 2011-07-23 05:23:06 PDT ---
(In reply to comment #3)

> This is keeping consistent feature.
> Current D allow compilation of following code:
> 
> TypeTuple!(int, int) f = 10;
> assert(f[0] == 10);
> assert(f[1] == 10);

I didn't know this, thank you. So the semantics of TypeTuple is broken. This
design mistake must not be carried over to Tuples too. Consistancy with a so
wrong design is like shooting yourself in the foot and makes this whole
enhancement request of negative value.

It's better to fix this TypeTuple design bug instead. I will file an
enhancement request on it.

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #4 from bearophile_h...@eml.cc 2011-07-23 05:18:55 PDT ---
Optionally there is the foreach use case too. A possible syntax:

auto array = [tuple(1,"foo"), tuple(2,"bar")];
foreach (tuple(id, name); array) {}

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #3 from Kenji Hara  2011-07-23 05:17:57 PDT ---
(In reply to comment #2)
> (In reply to comment #0)
> 
> > auto (n1, n2) = 100;  // non tuple initializer
> > assert(n1 == 100);
> > assert(n2 == 100);
> 
> This *must* be a compile-time error.

This is keeping consistent feature.
Current D allow compilation of following code:

TypeTuple!(int, int) f = 10;
assert(f[0] == 10);
assert(f[1] == 10);

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #2 from bearophile_h...@eml.cc 2011-07-23 05:14:44 PDT ---
(In reply to comment #0)

> auto (n1, n2) = 100;  // non tuple initializer
> assert(n1 == 100);
> assert(n2 == 100);

This *must* be a compile-time error.

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


[Issue 6365] AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #1 from Kenji Hara  2011-07-23 05:08:51 PDT ---
Also we can allow a static array on initializer like follows:

auto (x, y) = [10, 20];
assert(x == 10);
assert(y == 20);

But, it has a bit problem.

auto (x, y) = [10, 20, 30];  // interpreted as non tuple initializer
assert(x == [10, 20, 30]);
assert(y == [10, 20, 30]);

auto (x, y) = [10];  // interpreted as non tuple initializer
assert(x == [10]);
assert(y == [10]);

It is not inconsistent, but less useful.

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


[Issue 6365] New: AutoTupleDeclaration

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365

   Summary: AutoTupleDeclaration
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara  2011-07-23 05:00:58 PDT ---
Syntax:
'auto' '(' Identifier [',' Identifier ...] ')' '=' Initializer ';'

Example:
auto (num, msg) = TypeTuple!(1, "hello");  // built-in tuple
assert(num == 1);
assert(msg == "hello");

auto (name, age) = tuple("John", 10);  // library tuple (= alias this tuple)
assert(name == "John");
assert(age == 10);

auto (n1, n2) = 100;  // non tuple initializer
assert(n1 == 100);
assert(n2 == 100);

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


[Issue 6364] New: Static struct's destructor called on exit of function

2011-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6364

   Summary: Static struct's destructor called on exit of function
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-07-22 
22:08:18 PDT ---
import std.stdio;

void main()
{
   test();
   test();
}

struct Foo
{
   int state = 1;

   ~this()
   {
   state = 0;
   }
}

void test()
{
   static Foo foo;
   writeln(foo.state);
}


Prints:
1
0

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