From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Thunked package =?utf-8?B?4oCYYXJndW1lbnRz4oCZ?= Date: Wed, 23 Jan 2013 23:35:12 +0100 Message-ID: <878v7jv87z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty8ug-0001jo-Ue for bug-guix@gnu.org; Wed, 23 Jan 2013 17:35:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ty8ue-00037q-7j for bug-guix@gnu.org; Wed, 23 Jan 2013 17:35:22 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:55350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty8ue-00037a-0i for bug-guix@gnu.org; Wed, 23 Jan 2013 17:35:20 -0500 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: bug-guix@gnu.org Hi! With commit 21c203a, the =E2=80=98arguments=E2=80=99 field of packages is a= utomatically =E2=80=9Cthunked=E2=80=9D=E2=80=93i.e., wrapped in a zero-argument closure.= This allows the value of =E2=80=98arguments=E2=80=99 to refer to the =E2=80=98%current-syst= em=E2=80=99 fluid to do all things system-specific. Previously, when the value of =E2=80=98arguments=E2=80=99 was system-depend= ent, one had to write: (arguments (lambda (system) (if (string=3D? system "i686-linux") ...))) Now, one can just write: (arguments (if (string=3D? (%current-system) "i686-linux") ...)) ... and =E2=80=98%current-system=E2=80=99 is called within the dynamic exte= nt of =E2=80=98package-derivation=E2=80=99 (IOW, it does the right thing, if you = prefer. ;-)) Yet, =E2=80=98package-arguments=E2=80=99 always returns a list, transparent= ly calling the thunk. This leads to a more concise style, simplifies code in many places, and is more extensible (for instance, adding (%cross-system) when cross-compilation is supported will be trivial.) You should now run =E2=80=98make clean && make=E2=80=99. I think I have converted all the places that had a lambda as their =E2=80=98arguments=E2=80=99, or that tested the return type of =E2=80=98pro= cedure-arguments=E2=80=99, but I could have left some. So please report any issues! Eventually I=E2=80=99ll change other fields to be thunked, such as =E2=80= =98inputs=E2=80=99. Thanks, Ludo=E2=80=99.