Walter Bright wrote:
Of course that's true, but why is a dedicated syntax better than Tuple!(
...) ?
Why is dedicated syntax for comma expressions better than commaExpr(...)
? I take it most folks on this NG would prefer to have shorter syntax
for tuples instead the virtually never used comma
On Thu, Jul 23, 2009 at 10:49:49PM +0100, Tom S wrote:
> Why is dedicated syntax for comma expressions better than commaExpr(...)?
What do you propose we do about the commas in loops? Breaking them
would be a pretty big change to the C folks.
With the naked comma tuple, how do you pass them to a
Adam D. Ruppe wrote:
> It might be my years of C bias, but the naked tuples just look wrong.
There are ways -- elegant ways, I believe -- to make it work.
Would you look at this page and give me your opinion?
http://code.google.com/p/mist/wiki/Tuples
I'm not sure if it can ever work for D, to
On Fri, Jul 24, 2009 at 12:03:37AM +0200, Michiel Helvensteijn wrote:
> Would you look at this page and give me your opinion?
Looking at it quickly, the big difference seems to be you leave the tuple
word off, and use them in more places.
Is
Tuple!(int, bool) A = tuple(a, b)
really that much wo
Adam D. Ruppe wrote:
> By keeping the tuple word there, it is no longer conflicting with my C
> expectations, but seems to be just as useful as your proposal.
Hm. Then I believe you haven't read the whole thing. (That's ok, it does go
on for a while.) Yes, much of the appeal is in the shorter syn
Adam D. Ruppe wrote:
On Fri, Jul 24, 2009 at 12:03:37AM +0200, Michiel Helvensteijn wrote:
Would you look at this page and give me your opinion?
Looking at it quickly, the big difference seems to be you leave the tuple
word off, and use them in more places.
Is
Tuple!(int, bool) A = tuple(a,
On Thu, Jul 23, 2009 at 3:41 PM, Adam D. Ruppe wrote:
> On Fri, Jul 24, 2009 at 12:03:37AM +0200, Michiel Helvensteijn wrote:
>> Would you look at this page and give me your opinion?
>
> Looking at it quickly, the big difference seems to be you leave the tuple
> word off, and use them in more place
On Thu, Jul 23, 2009 at 6:10 PM, Adam D. Ruppe wrote:
>
> What do you propose we do about the commas in loops? Breaking them
> would be a pretty big change to the C folks.
It's trivial to allow a comma-separated list of expressions in the for
loop header. If Pythonic tuple syntax were used (i.e.
On Thu, Jul 23, 2009 at 11:49:29PM +0100, Tom S wrote:
> It's not much worse, but it's not everything that's to tuples. Here's
> one more example:
>
> > int a, b;
>
>
>
> > a, b = 2, 3;
Why would you ever want to do that when you have:
a = 2;
b = 3;
I see people ask why would you ever
On Thu, Jul 23, 2009 at 05:53:35PM -0700, Bill Baxter wrote:
> Uh, yes. Yes it is.
> But I have to say I'm always amazed what clutter some people are
> apparently willing to put up with when I look at just about any page
> of MSDN.
And I'm amazed at the illegibility some people are apparently wil
On Fri, Jul 24, 2009 at 12:37:42AM +0200, Michiel Helvensteijn wrote:
> Hm. Then I believe you haven't read the whole thing.
Yeah, I just briefly skimmed it. I'll have to go back to it for a full read
when I have a little more time.
> Looking like C is not the be-all and end-all of programming l
On Thu, 23 Jul 2009 21:22:03 -0400, Adam D. Ruppe wrote:
>
> I could see a function returning it as being potentially useful for the
> x,y case:
>
> Tuple!(int, int) getPoint() { return tuple(x, y); } ...
>
> x, y = getPoint();
>
>
> But, a better way to do this would be:
>
> Tuple!(int, "x"
On Fri, Jul 24, 2009 at 01:38:30AM +, Jesse Phillips wrote:
> Thanks for the tutorial, expect to see it on Wiki4D within a year :D
This actually doesn't /quite/ work, since the tuple returned by tuple() has
unnamed fields, which is a different type than the one with named fields.
Gah.
This w
On Thu, 23 Jul 2009 22:56:44 -0400, Adam D. Ruppe wrote:
> On Fri, Jul 24, 2009 at 01:38:30AM +, Jesse Phillips wrote:
>> Thanks for the tutorial, expect to see it on Wiki4D within a year :D
>
> This actually doesn't /quite/ work, since the tuple returned by tuple()
> has unnamed fields, whic
Adam D. Ruppe wrote:
(...) It is two brief lines longer to copy them to a local x and y if you want
to.
Remember delegate literals? They were just a few more tokens, but it
wasn't until the shorthand syntax was introduced that everyone started
using them. I mean, how hard is it to type the e
Adam D. Ruppe, el 23 de julio a las 22:56 me escribiste:
> On Fri, Jul 24, 2009 at 01:38:30AM +, Jesse Phillips wrote:
> > Thanks for the tutorial, expect to see it on Wiki4D within a year :D
>
> This actually doesn't /quite/ work, since the tuple returned by tuple() has
> unnamed fields, whic
On Fri, 24 Jul 2009 12:30:23 -0300, Leandro Lucarella wrote:
> Adam D. Ruppe, el 23 de julio a las 22:56 me escribiste:
>> Tuple!(int, int) getPoint() { return tuple(5,2); }
>>
>> That works, but then you have to address the return value as:
>>
>> auto p = getPoint();
>> p.field[0] == 5
>> p.fi
Jesse Phillips, el 25 de julio a las 03:38 me escribiste:
> > But you should support multple assignment, for example. If you don't,
> > you don't have real tuple support, just a toy tuple emulation.
>
> Tuples have nothing to do with multiple assignment, it is just something
> languages tend to p
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.
On Sat, Jul 25, 2009 at 01:20:33PM -0600, Rainer Deyke wrote:
> >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
> s
On Sat, Jul 25, 2009 at 02:15:00PM -0300, Leandro Lucarella wrote:
> if not, it's just syntax sugar for structs,
> or some kind of limited list.
Interestingly, I've been looking at tuples almost entirely as "anonymous
structs", if you will. Perhaps this is another bias preventing me from seeing
th
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 suga
22 matches
Mail list logo