digitalmars.D - dlist for phobos
- %u (4/4) Jan 26 2011 Are there plans for including a double linked list in phobos? Maybe
- Jonathan M Davis (7/11) Jan 26 2011 Array is the equivalent of Java's ArrayList. It's Java's LinkedList whic...
- Andrei Alexandrescu (11/22) Jan 26 2011 One big issue with std.container is that the absence of unified function...
- bearophile (4/7) Jan 27 2011 Language improvements need to be understood, desired, designed, and then...
- Andrei Alexandrescu (3/10) Jan 27 2011 ref returns should be guaranteed to never escape.
- Tomek =?ISO-8859-2?Q?Sowi=F1ski?= (5/6) Jan 27 2011 Should meaning they're not guaranteed now? I'm curious in what scenarios...
- Andrei Alexandrescu (4/7) Jan 27 2011 Any function can take the address of a reference (either a ref parameter...
- Tomek =?ISO-8859-2?Q?Sowi=F1ski?= (8/17) Jan 27 2011 =20
- Michel Fortin (23/33) Jan 27 2011 Even in @safe mode? Being able to take the address of a ref in non-safe
- Steven Schveighoffer (5/8) Jan 26 2011 http://www.dsource.org/projects/dcollections
Are there plans for including a double linked list in phobos? Maybe one backed by an array like .NET's List<T> or Java's ArrayList. If so, when? Thanks
Jan 26 2011
On Wednesday, January 26, 2011 15:34:05 %u wrote:Are there plans for including a double linked list in phobos? Maybe one backed by an array like .NET's List<T> or Java's ArrayList. If so, when?Array is the equivalent of Java's ArrayList. It's Java's LinkedList which is a doubly-linked list. You don't normally use arrays to implement linked lists. We do have a _singly_-linked list - SList - but not doubly-linked list at the moment. I'd be stunned if Andrei doesn't intend to add one at some point though. However, std.container was slow in coming, and it's been slow in growing. - Jonathan M Davis
Jan 26 2011
On 1/26/11 6:20 PM, Jonathan M Davis wrote:On Wednesday, January 26, 2011 15:34:05 %u wrote:One big issue with std.container is that the absence of unified function call syntax forces the implementation to add a lot of aliases. I'm sort of stalling in hope that language improvements will prompt terser container implementations. I'm also undecided on what to do about sealing, and again language improvements (preventing escapes of references) could lead to improved designs. That being said, a doubly-linked list is an obvious candidate as the next significant container to put in std.container. AndreiAre there plans for including a double linked list in phobos? Maybe one backed by an array like .NET's List<T> or Java's ArrayList. If so, when?Array is the equivalent of Java's ArrayList. It's Java's LinkedList which is a doubly-linked list. You don't normally use arrays to implement linked lists. We do have a _singly_-linked list - SList - but not doubly-linked list at the moment. I'd be stunned if Andrei doesn't intend to add one at some point though. However, std.container was slow in coming, and it's been slow in growing. - Jonathan M Davis
Jan 26 2011
Andrei:I'm also undecided on what to do about sealing, and again language improvements (preventing escapes of references) could lead to improved designs.Language improvements need to be understood, desired, designed, and then implemented and debugged, so what kind of syntax and semantics are you thinking about? Bye, bearophile
Jan 27 2011
On 1/27/11 3:25 AM, bearophile wrote:Andrei:ref returns should be guaranteed to never escape. AndreiI'm also undecided on what to do about sealing, and again language improvements (preventing escapes of references) could lead to improved designs.Language improvements need to be understood, desired, designed, and then implemented and debugged, so what kind of syntax and semantics are you thinking about? Bye, bearophile
Jan 27 2011
Andrei Alexandrescu napisa=B3:ref returns should be guaranteed to never escape.Should meaning they're not guaranteed now? I'm curious in what scenarios th= ey escape. --=20 Tomek
Jan 27 2011
On 1/27/11 4:48 PM, Tomek Sowiński wrote:Andrei Alexandrescu napisał:Any function can take the address of a reference (either a ref parameter or the result of another function) and squirrel it away. Andreiref returns should be guaranteed to never escape.Should meaning they're not guaranteed now? I'm curious in what scenarios they escape.
Jan 27 2011
Andrei Alexandrescu napisa=B3:On 1/27/11 4:48 PM, Tomek Sowi=F1ski wrote:s they escape.Andrei Alexandrescu napisa=B3:ref returns should be guaranteed to never escape.Should meaning they're not guaranteed now? I'm curious in what scenario==20 Any function can take the address of a reference (either a ref parameter==20or the result of another function) and squirrel it away.Jeez.. I must've had some brain-warp that I didn't think of &r.front :-) But is just banning taking addresses of ref parameters and return values go= ing to solve the problem? Sounds delusively simple... --=20 Tomek
Jan 27 2011
On 2011-01-27 17:52:27 -0500, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> said:On 1/27/11 4:48 PM, Tomek SowiĆski wrote:Even in safe mode? Being able to take the address of a ref in non-safe code seems normal to me. That said, you don't need to take the address of anything to escape a ref: ref int test() { int i; return pass(i); } ref int pass(ref int i) { return i; } Now, consider that instead of 'int i' you have a container with deterministic destruction: ref int test() { Container!int a; return a[0]; } Same problem. -- Michel Fortin michel.fortin michelf.com http://michelf.com/Andrei Alexandrescu napisaĆ:Any function can take the address of a reference (either a ref parameter or the result of another function) and squirrel it away.ref returns should be guaranteed to never escape.Should meaning they're not guaranteed now? I'm curious in what scenarios they escape.
Jan 27 2011
On Wed, 26 Jan 2011 18:34:05 -0500, %u <ee ee.com> wrote:Are there plans for including a double linked list in phobos? Maybe one backed by an array like .NET's List<T> or Java's ArrayList. If so, when?http://www.dsource.org/projects/dcollections LinkList there is doubly-linked. Sorry, I don't have online docs yet for the d2 version... *kicks self* -Steve
Jan 26 2011