Comma expressions must die [Was: Reddit: why aren't people using D?]

Leandro Lucarella llucax at gmail.com
Sat Jul 25 15:50:52 PDT 2009


Rainer Deyke, el 25 de julio a las 13:20 me escribiste:
> Leandro Lucarella wrote:
> > It has, providing tuples without that generally doesn't need language
> > support, like D or C++ tuples. When you have multiple assignment, you can
> > fully use the power of tuples, if not, it's just syntax sugar for structs,
> > or some kind of limited list.
> 
> From the Boost.Tuple documentation:
> 
>   int i; char c; double d;
>   tie(i, c, d) = make_tuple(1,'a', 5.5);
>   std::cout << i << " " <<  c << " " << d;
> 
> So C++ tuples *do* support multiple assignment, even without language
> support.  Still not as nice as the Python syntax, though.

But you have to split declaration from initialization. That's not nice.

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Yo soy Peperino Mártir Sanito, yo soy aquel, que come los flanes
serenito.
	-- Peperino Pómoro



More information about the Digitalmars-d mailing list