From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id EE990138825 for ; Tue, 11 Nov 2014 09:14:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AFA8CE0A9F; Tue, 11 Nov 2014 09:14:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2F861E0A9E for ; Tue, 11 Nov 2014 09:14:53 +0000 (UTC) Received: from [10.0.10.112] (unknown [195.254.219.2]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: bernalex) by smtp.gentoo.org (Postfix) with ESMTPSA id A06AF3403EC for ; Tue, 11 Nov 2014 09:14:51 +0000 (UTC) Message-ID: <5461D389.3000804@gentoo.org> Date: Tue, 11 Nov 2014 10:14:49 +0100 From: Alexander Berntsen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH] unprivileged mode: generate PORTAGE_DEPCACHEDIR References: <1415575480-19505-1-git-send-email-zmedico@gentoo.org> <54609D06.5020101@gentoo.org> <54610217.3080707@gentoo.org> <546120FA.9060305@gentoo.org> <5461559F.2050808@gentoo.org> In-Reply-To: <5461559F.2050808@gentoo.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 2a30a583-df11-479c-8781-ac7c79c231f2 X-Archives-Hash: 19bdea1b9db3410c88511035b46b1188 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 11/11/14 01:17, Zac Medico wrote: > We could certainly express it in a way that doesn't involve any > mutating loop control variables, but ultimately that's going to > lead to more lines of code, and it will leave imperative > programmers wondering why we didn't choose a simpler and more > succinct approach. > > For example, we could create an class for iterating over the paths > from a given path down to the root directory. Then we could create > a function which selects the first element from that iterator that > exists. Once the class and function are implemented, their usage > would be very succinct: > > first_parent = first_existing(iter_parents(path)) I would greatly prefer this. But I suppose I'm in a minority. v2 of the patch is fine by me. - -- Alexander bernalex@gentoo.org https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlRh04kACgkQRtClrXBQc7Wg7AD/WmncYIvR/f6OZ9W2mVfpgMmL pZRD+68xWgWTdvatodYBAIX9VfX/0kINsmV9RhzumhLnHYE7LMz43nLy+yrekbxp =H68V -----END PGP SIGNATURE-----