[Issue 10119] Add tuple overload which automatically captures the names of symbols

2014-05-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10119

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

   What|Removed |Added

 CC||jcrapuchet...@gmail.com

--- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com ---
@jcrapuchettes: I have a feeling this may have been something you were looking
for when you mentioned named tuples yesterday? Either way it's a small piece of
code you can use adapt and right now, so feel free to take it.

--


[Issue 10119] Add tuple overload which automatically captures the names of symbols

2013-10-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10119


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX


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


[Issue 10119] Add tuple overload which automatically captures the names of symbols

2013-05-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10119


Jakob Ovrum jakobov...@gmail.com changed:

   What|Removed |Added

 CC||jakobov...@gmail.com


--- Comment #1 from Jakob Ovrum jakobov...@gmail.com 2013-05-19 11:55:15 PDT 
---
No, this instead. (per IRC request)

https://gist.github.com/JakobOvrum/5608585
--
import std.typecons : Tuple;
import std.typetuple : TypeTuple;

template NameTypePairs(alias front, vars...)
{
private enum name = __traits(identifier, front);
private alias pair = TypeTuple!(typeof(front), name);

static if(vars.length == 0)
alias NameTypePairs = pair;
else
alias NameTypePairs =  TypeTuple!(pair, NameTypePairs!vars);
}

auto tuplify(vars...)()
{
return Tuple!(NameTypePairs!vars)(vars);
}

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


[Issue 10119] Add tuple overload which automatically captures the names of symbols

2013-05-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10119



--- Comment #2 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-05-19 
12:00:50 PDT ---
(In reply to comment #1)
 No, this instead. (per IRC request)

That one is also faster and more generic-style instead of magic-mixin-style.
*Nods head in approval*.

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


[Issue 10119] Add tuple overload which automatically captures the names of symbols

2013-05-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10119


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #3 from bearophile_h...@eml.cc 2013-05-19 16:10:45 PDT ---
I think we should just add tuples to D. I think a possible syntax is
tuple(...).

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