Re: Take and website

2012-07-25 Thread Christophe Travert
Russel Winder , dans le message (digitalmars.D:173102), a écrit : --=-aHxuwwF1pyt7fCGYFQXP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 2012-07-24 at 13:56 -0400, Andrei Alexandrescu wrote: [=E2=80=A6] The example is: =20 int[] arr1 =3D [

Take and website

2012-07-24 Thread Russel Winder
I am wondering if the examples at http://dlang.org/phobos/std_range.html#take need some attention. As far as I can see they only work because the input is a list. If you take from the result of an algorithm such as recurrence then you have to explicitly create an array from the result of the take

Re: Take and website

2012-07-24 Thread Walter Bright
On 7/24/2012 10:10 AM, Russel Winder wrote: I am wondering if the examples at http://dlang.org/phobos/std_range.html#take need some attention. As far as I can see they only work because the input is a list. If you take from the result of an algorithm such as recurrence then you have to

Re: Take and website

2012-07-24 Thread Andrei Alexandrescu
On 7/24/12 1:10 PM, Russel Winder wrote: I am wondering if the examples at http://dlang.org/phobos/std_range.html#take need some attention. As far as I can see they only work because the input is a list. If you take from the result of an algorithm such as recurrence then you have to explicitly

Re: Take and website

2012-07-24 Thread Russel Winder
On Tue, 2012-07-24 at 13:56 -0400, Andrei Alexandrescu wrote: […] The example is: int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; auto s = take(arr1, 5); assert(s.length == 5); assert(s[4] == 5); assert(equal(s, [ 1, 2, 3, 4, 5 ][])); Were you referring to this? Example code does not

Re: Take and website

2012-07-24 Thread Andrei Alexandrescu
On 7/24/12 2:17 PM, Russel Winder wrote: That's the one. s[4] relies on the fact that arr1 is an array: ( takeExactly ( recurrence ! ( a[n-1] + a[n-2] ) ( 0L , 1L ) , cast ( size_t ) ( n + 1 ) ) ) [ n ] fails with operator [] not defined, I find I have to: array ( takeExactly ( recurrence

Re: Take and website

2012-07-24 Thread Russel Winder
On Tue, 2012-07-24 at 14:21 -0400, Andrei Alexandrescu wrote: […] I must have gotten a bit too used to it, but I think that's quite a basic reality imposed by the types involved... yes, that's as clear as xyz = 4.5 only works if xyz is of some certain types. I think the point here is that

Re: Take and website

2012-07-24 Thread José Armando García Sancio
On Tue, Jul 24, 2012 at 11:47 AM, Russel Winder rus...@winder.org.uk wrote: On Tue, 2012-07-24 at 14:21 -0400, Andrei Alexandrescu wrote: […] Is the website documentation generated from the Phobos source or is it a separate repository? That particular example should be in the ddoc block for

Re: Take and website

2012-07-24 Thread Andrei Alexandrescu
On 7/24/12 2:47 PM, Russel Winder wrote: On Tue, 2012-07-24 at 14:21 -0400, Andrei Alexandrescu wrote: […] I must have gotten a bit too used to it, but I think that's quite a basic reality imposed by the types involved... yes, that's as clear as xyz = 4.5 only works if xyz is of some certain

Re: Take and website

2012-07-24 Thread Nick Sabalausky
On Tue, 24 Jul 2012 19:47:42 +0100 Russel Winder rus...@winder.org.uk wrote: Is the website documentation generated from the Phobos source or is it a separate repository? (He says giving away his green-ness at the D community infrastructure!) The Phobos documentation is generated from the