1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA256 |
3 |
|
4 |
On 11/11/14 01:17, Zac Medico wrote: |
5 |
> We could certainly express it in a way that doesn't involve any |
6 |
> mutating loop control variables, but ultimately that's going to |
7 |
> lead to more lines of code, and it will leave imperative |
8 |
> programmers wondering why we didn't choose a simpler and more |
9 |
> succinct approach. |
10 |
> |
11 |
> For example, we could create an class for iterating over the paths |
12 |
> from a given path down to the root directory. Then we could create |
13 |
> a function which selects the first element from that iterator that |
14 |
> exists. Once the class and function are implemented, their usage |
15 |
> would be very succinct: |
16 |
> |
17 |
> first_parent = first_existing(iter_parents(path)) |
18 |
I would greatly prefer this. But I suppose I'm in a minority. v2 of |
19 |
the patch is fine by me. |
20 |
|
21 |
- -- |
22 |
Alexander |
23 |
bernalex@g.o |
24 |
https://secure.plaimi.net/~alexander |
25 |
-----BEGIN PGP SIGNATURE----- |
26 |
Version: GnuPG v2 |
27 |
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ |
28 |
|
29 |
iF4EAREIAAYFAlRh04kACgkQRtClrXBQc7Wg7AD/WmncYIvR/f6OZ9W2mVfpgMmL |
30 |
pZRD+68xWgWTdvatodYBAIX9VfX/0kINsmV9RhzumhLnHYE7LMz43nLy+yrekbxp |
31 |
=H68V |
32 |
-----END PGP SIGNATURE----- |