My Issues with Slices and AAs

2012-03-02 Thread Kevin Cox
After learning and using D for a little while I have discovered some (in my opinion) problems with the slices and associative array built-ins (for now I will just say slice). The main issue I have is that there is no way to pass around something that looks like and acts like a slice. This is

Re: My Issues with Slices and AAs

2012-03-02 Thread Jesse Phillips
On Friday, 2 March 2012 at 13:33:17 UTC, Kevin Cox wrote: After learning and using D for a little while I have discovered some (in my opinion) problems with the slices and associative array built-ins (for now I will just say slice). The main issue I have is that there is no way to pass around

Re: My Issues with Slices and AAs

2012-03-02 Thread Ali Çehreli
On 03/02/2012 06:03 AM, Jesse Phillips wrote: On Friday, 2 March 2012 at 13:33:17 UTC, Kevin Cox wrote: After learning and using D for a little while I have discovered some (in my opinion) problems with the slices and associative array built-ins (for now I will just say slice). The main

Re: My Issues with Slices and AAs

2012-03-02 Thread Andrei Alexandrescu
On 3/2/12 7:33 AM, Kevin Cox wrote: [snip] In, conclusion. (Tl:Dr) slices and AAs do not allow polymorphism and therefore are decreasing the power and flexibility of D. Slices are primitive, concrete components that are close to the metal and are best for implementing abstractions, not

Re: My Issues with Slices and AAs

2012-03-02 Thread Kevin Cox
On Mar 2, 2012 10:30 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote Slices are primitive, concrete components that are close to the metal and are best for implementing abstractions, not defining them. You can always build and use abstract interfaces (that may or may not use slices

Re: My Issues with Slices and AAs

2012-03-02 Thread Andrei Alexandrescu
On 3/2/12 10:24 AM, Kevin Cox wrote: Although if slices are still built-in but act as if they are part of an interface will that slow them down? And, if so where is the slowdown? Is it in the interfaces? Yes, a traditional interface (in the sense I gather you use it) uses indirection by

Re: My Issues with Slices and AAs

2012-03-02 Thread Kevin
On 03/02/2012 09:03 AM, Jesse Phillips wrote: D is not purely object oriented and must provide primitives the meet or exceed C. The style for D code also tends to templates and meta programming. Ranges[1] fit nicely to this and the idea of slicing. 1. http://dlang.org/phobos/std_range.html

Re: My Issues with Slices and AAs

2012-03-02 Thread Xinok
On Saturday, 3 March 2012 at 05:00:53 UTC, Kevin wrote: Is there something on ranges that is more of a write-up. Something to explain purpose, implementation, usage, ...? Or if not some code that makes good use of ranges? Thanks, Kevin http://ddili.org/ders/d.en/ranges.html

Re: My Issues with Slices and AAs

2012-03-02 Thread Kevin Cox
On Sat, Mar 3, 2012 at 12:09 AM, Xinok xi...@live.com wrote: http://ddili.org/ders/d.en/**ranges.htmlhttp://ddili.org/ders/d.en/ranges.html Thanks for the great link. And thanks everyone for your help. I can't believe I missed ranges as they are exactly what I wanted. Kevin