Re: Pair literal for D language

2014-06-29 Thread Mason McGill via Digitalmars-d
On Saturday, 28 June 2014 at 21:12:06 UTC, Timon Gehr wrote: On 06/28/2014 06:11 PM, Mason McGill wrote: On Saturday, 28 June 2014 at 09:15:29 UTC, Dicebot wrote: On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: I like DIP54 and I think the work on fixing tuples is awesome, but I

Re: Pair literal for D language

2014-06-29 Thread Dicebot via Digitalmars-d
On Sunday, 29 June 2014 at 16:03:07 UTC, Mason McGill wrote: I understand, but I was talking about `var` being referred to as a `TemplateArgumentList` when it's not used as such. It's used as an `ArgumentList`, just not a `TemplateArgumentList`. Why do you expect template argument list to be

Re: Pair literal for D language

2014-06-29 Thread Tofu Ninja via Digitalmars-d
On Sunday, 29 June 2014 at 16:09:15 UTC, Dicebot wrote: On Sunday, 29 June 2014 at 16:03:07 UTC, Mason McGill wrote: I understand, but I was talking about `var` being referred to as a `TemplateArgumentList` when it's not used as such. It's used as an `ArgumentList`, just not a

Re: Pair literal for D language

2014-06-29 Thread Dicebot via Digitalmars-d
On Sunday, 29 June 2014 at 20:44:06 UTC, Tofu Ninja wrote: On Sunday, 29 June 2014 at 16:09:15 UTC, Dicebot wrote: On Sunday, 29 June 2014 at 16:03:07 UTC, Mason McGill wrote: I understand, but I was talking about `var` being referred to as a `TemplateArgumentList` when it's not used as such.

Re: Pair literal for D language

2014-06-29 Thread deadalnix via Digitalmars-d
On Sunday, 29 June 2014 at 21:24:15 UTC, Dicebot wrote: I am honestly trying to understand people thought flow goes that makes them expect such things :) That may help to come with better idea (no currently proposed name is any good) Quite frankly any name is better than that except tuple.

Re: Pair literal for D language

2014-06-28 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-26 23:16, H. S. Teoh via Digitalmars-d wrote: Note that the word tuple in D is used to refer to two very different things. What you want is essentially an anonymous struct, and should be adequately covered by std.typecons.tuple. I would like some form of anonymous struct, with some

Re: Pair literal for D language

2014-06-28 Thread Dicebot via Digitalmars-d
On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: I like DIP54 and I think the work on fixing tuples is awesome, but I have 1 nit-picky question: why is it called TemplateArgumentList when it's not always used as template arguments? void func(string, string) { }

Re: Pair literal for D language

2014-06-28 Thread Mason McGill via Digitalmars-d
On Saturday, 28 June 2014 at 09:15:29 UTC, Dicebot wrote: On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: I like DIP54 and I think the work on fixing tuples is awesome, but I have 1 nit-picky question: why is it called TemplateArgumentList when it's not always used as template

Re: Pair literal for D language

2014-06-28 Thread deadalnix via Digitalmars-d
On Saturday, 28 June 2014 at 09:15:29 UTC, Dicebot wrote: On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: I like DIP54 and I think the work on fixing tuples is awesome, but I have 1 nit-picky question: why is it called TemplateArgumentList when it's not always used as template

Re: Pair literal for D language

2014-06-28 Thread deadalnix via Digitalmars-d
On Friday, 27 June 2014 at 05:45:19 UTC, H. S. Teoh via Digitalmars-d wrote: We'd make a step forward when we stop calling type tuples type tuples. They are not tuples, and do not contain (only) types. I agree, but that's what they're called in the compiler source code, so it's kinda hard

Re: Pair literal for D language

2014-06-28 Thread Dicebot via Digitalmars-d
On Saturday, 28 June 2014 at 19:39:35 UTC, deadalnix wrote: You keep repeating that, but people keep being confused. It is time to admit defeat. I don't think any name is possible which don't keep someone confused - as long as this entity behaves as it does. 'StaticList' is what you may

Re: Pair literal for D language

2014-06-28 Thread Timon Gehr via Digitalmars-d
On 06/28/2014 06:11 PM, Mason McGill wrote: On Saturday, 28 June 2014 at 09:15:29 UTC, Dicebot wrote: On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: I like DIP54 and I think the work on fixing tuples is awesome, but I have 1 nit-picky question: why is it called

Re: Pair literal for D language

2014-06-28 Thread Dicebot via Digitalmars-d
On Saturday, 28 June 2014 at 16:11:15 UTC, Mason McGill wrote: Understood. I was just expressing my initial impression: that it seemed strange that a symbol declared as a `TemplateArgumentList` was neither passed nor received as template arguments. My hope is that having such surprising name

Re: Pair literal for D language

2014-06-28 Thread Timon Gehr via Digitalmars-d
On 06/28/2014 09:40 PM, deadalnix wrote: On Friday, 27 June 2014 at 05:45:19 UTC, H. S. Teoh via Digitalmars-d wrote: We'd make a step forward when we stop calling type tuples type tuples. They are not tuples, and do not contain (only) types. I agree, but that's what they're called in the

Re: Pair literal for D language

2014-06-28 Thread H. S. Teoh via Digitalmars-d
On Sat, Jun 28, 2014 at 09:15:18PM +, Dicebot via Digitalmars-d wrote: On Saturday, 28 June 2014 at 16:11:15 UTC, Mason McGill wrote: Understood. I was just expressing my initial impression: that it seemed strange that a symbol declared as a `TemplateArgumentList` was neither passed nor

Re: Pair literal for D language

2014-06-28 Thread Dicebot via Digitalmars-d
On Saturday, 28 June 2014 at 21:25:31 UTC, H. S. Teoh via Digitalmars-d wrote: We've had this discussion before (and not just once), that tuple is a misnomer, yada yada yada, but until somebody files a PR to change this, things are just going to continue to remain the same. So I'd say,

Re: Pair literal for D language

2014-06-28 Thread deadalnix via Digitalmars-d
On Saturday, 28 June 2014 at 21:22:14 UTC, Timon Gehr wrote: On 06/28/2014 09:40 PM, deadalnix wrote: On Friday, 27 June 2014 at 05:45:19 UTC, H. S. Teoh via Digitalmars-d wrote: We'd make a step forward when we stop calling type tuples type tuples. They are not tuples, and do not contain

Re: Pair literal for D language

2014-06-28 Thread Ary Borenszweig via Digitalmars-d
On 6/28/14, 6:49 PM, deadalnix wrote: On Saturday, 28 June 2014 at 21:22:14 UTC, Timon Gehr wrote: On 06/28/2014 09:40 PM, deadalnix wrote: On Friday, 27 June 2014 at 05:45:19 UTC, H. S. Teoh via Digitalmars-d wrote: We'd make a step forward when we stop calling type tuples type tuples. They

Re: Pair literal for D language

2014-06-28 Thread safety0ff via Digitalmars-d
On Saturday, 28 June 2014 at 21:51:17 UTC, Ary Borenszweig wrote: I think it's common: http://julia.readthedocs.org/en/latest/manual/types/#tuple-types Actually, that section is about normal tuples, there is no distinction between normal tuples and type tuples in julia. From Julia repl:

Re: Pair literal for D language

2014-06-28 Thread Timon Gehr via Digitalmars-d
On 06/29/2014 12:42 AM, safety0ff wrote: On Saturday, 28 June 2014 at 21:51:17 UTC, Ary Borenszweig wrote: I think it's common: http://julia.readthedocs.org/en/latest/manual/types/#tuple-types Actually, that section is about normal tuples, there is no distinction between normal tuples and

Re: Pair literal for D language

2014-06-27 Thread Dicebot via Digitalmars-d
On Friday, 27 June 2014 at 05:45:19 UTC, H. S. Teoh via Digitalmars-d wrote: I agree, but that's what they're called in the compiler source code, so it's kinda hard to call them something else. Most people never look in compiler source code so lets pretend it does not exist ;)

Re: Pair literal for D language

2014-06-27 Thread H. S. Teoh via Digitalmars-d
On Fri, Jun 27, 2014 at 06:32:34PM +, Dicebot via Digitalmars-d wrote: On Friday, 27 June 2014 at 05:45:19 UTC, H. S. Teoh via Digitalmars-d wrote: I agree, but that's what they're called in the compiler source code, so it's kinda hard to call them something else. Most people never look

Re: Pair literal for D language

2014-06-27 Thread Dicebot via Digitalmars-d
On Friday, 27 June 2014 at 19:11:45 UTC, H. S. Teoh via Digitalmars-d wrote: On Fri, Jun 27, 2014 at 06:32:34PM +, Dicebot via Digitalmars-d wrote: On Friday, 27 June 2014 at 05:45:19 UTC, H. S. Teoh via Digitalmars-d wrote: I agree, but that's what they're called in the compiler source

Re: Pair literal for D language

2014-06-27 Thread Mason McGill via Digitalmars-d
I like DIP54 and I think the work on fixing tuples is awesome, but I have 1 nit-picky question: why is it called TemplateArgumentList when it's not always used as template arguments? void func(string, string) { } TypeTuple!(string, string) var; var[0] = I'm nobody's ; var[1] =

Re: Pair literal for D language

2014-06-27 Thread Tofu Ninja via Digitalmars-d
On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: StaticList/ExpandingList/StaticTuple/ExpandingTuple? I think StaticList is the clearest, really makes it obvious what it is.

Re: Pair literal for D language

2014-06-27 Thread deadalnix via Digitalmars-d
On Saturday, 28 June 2014 at 03:01:12 UTC, Tofu Ninja wrote: On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: StaticList/ExpandingList/StaticTuple/ExpandingTuple? I think StaticList is the clearest, really makes it obvious what it is. Static already mean everything, please no.

Re: Pair literal for D language

2014-06-27 Thread H. S. Teoh via Digitalmars-d
On Sat, Jun 28, 2014 at 05:00:09AM +, deadalnix via Digitalmars-d wrote: On Saturday, 28 June 2014 at 03:01:12 UTC, Tofu Ninja wrote: On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote: StaticList/ExpandingList/StaticTuple/ExpandingTuple? I think StaticList is the clearest,

Pair literal for D language

2014-06-26 Thread Uranuz via Digitalmars-d
Very often I use associative array as the simple syntactic way of representing of pairs of some values. But AAs are slightly complicated for this task and they don't preserve order inside it. I could use some struct for example struct P(T, N) { T first; N second; } and write something

Re: Pair literal for D language

2014-06-26 Thread bearophile via Digitalmars-d
Uranuz: I'd like to see any comments Built-in tuple literals: good. Just pair literals: no, thanks. Bye, bearophile

Re: Pair literal for D language

2014-06-26 Thread Uranuz via Digitalmars-d
Thanks for response. I was thinking that adding new statement for such feature is not very good too. Is there any recent discussions about tuble literals. There is proposal in wiki but I don't know if it will be accepted or not for some time. For now seems like it's better to alias tuple and

Re: Pair literal for D language

2014-06-26 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 26, 2014 at 09:08:24PM +, Uranuz via Digitalmars-d wrote: Thanks for response. I was thinking that adding new statement for such feature is not very good too. Is there any recent discussions about tuble literals. There is proposal in wiki but I don't know if it will be accepted

Re: Pair literal for D language

2014-06-26 Thread deadalnix via Digitalmars-d
On Thursday, 26 June 2014 at 21:17:45 UTC, H. S. Teoh via Digitalmars-d wrote: On Thu, Jun 26, 2014 at 09:08:24PM +, Uranuz via Digitalmars-d wrote: Thanks for response. I was thinking that adding new statement for such feature is not very good too. Is there any recent discussions about

Re: Pair literal for D language

2014-06-26 Thread H. S. Teoh via Digitalmars-d
On Fri, Jun 27, 2014 at 05:35:40AM +, deadalnix via Digitalmars-d wrote: On Thursday, 26 June 2014 at 21:17:45 UTC, H. S. Teoh via Digitalmars-d wrote: On Thu, Jun 26, 2014 at 09:08:24PM +, Uranuz via Digitalmars-d wrote: Thanks for response. I was thinking that adding new statement