Declaring Ref Variables Inside Function Calls

Leandro Lucarella llucax at gmail.com
Tue Mar 31 18:28:31 PDT 2009


Andrei Alexandrescu, el 31 de marzo a las 17:57 me escribiste:
> Leandro Lucarella wrote:
> >Bill Baxter, el  1 de abril a las 05:22 me escribiste:
> >>Right.  In my ideal world I could use tuples like this:
> >>
> >>(int,float) a;
> >>
> >>a = returns_tuple();
> >>
> >>a[0] = 2;
> >>a[1] = 3.4;
> >>
> >>(int,float) z = returns_tuple();
> >>
> >>(int x, float y) = returns_tuple();
> >>
> >>auto tup = (2, 3.4);
> >>
> >>takes_int_and_float(unpack!(tup));
> >>
> >>I think experience with tuples in Python and ML (and probably
> >>elsewhere -- heck even D) shows that tuples are incredibly useful.  So
> >>useful that they deserve better syntax than Tuple!(...).
> >Agree. They should be first class citizen as dynamic arrays or hashes.
> 
> Why? Not grokking it.

It's perfectly explained in this thread why, all I have to say will
repeate something already said (the int[] vs. std::vector<int> mostly). Of
course you don't seem to agree with those arguments...

If they are not 1st citizens you just end up:
1) not using them
2) making your code look like boost, I mean *really* ugly ;)
   (when what you want to do it's even possible, of course)

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Every year is getting shorter never seem to find the time.
Plans that either come to nought or half a page of scribbled lines.
Hanging on in quiet desparation is the English way.
The time is gone, the song is over, thought I'd something more to say.



More information about the Digitalmars-d mailing list