From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH 1/3] services: Add 'session-environment-service'. Date: Wed, 02 Dec 2015 21:45:49 +0300 Message-ID: <87mvtsheoy.fsf@gmail.com> References: <1449063511-689-1-git-send-email-iyzsong@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4CPZ-00080l-G5 for guix-devel@gnu.org; Wed, 02 Dec 2015 13:45:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4CPW-0006br-Aw for guix-devel@gnu.org; Wed, 02 Dec 2015 13:45:53 -0500 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:36020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4CPW-0006bc-3U for guix-devel@gnu.org; Wed, 02 Dec 2015 13:45:50 -0500 Received: by lfs39 with SMTP id 39so59178556lfs.3 for ; Wed, 02 Dec 2015 10:45:49 -0800 (PST) In-Reply-To: <1449063511-689-1-git-send-email-iyzsong@gmail.com> (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Wed, 2 Dec 2015 21:38:29 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?B?5a6L5paH5q2m?= Cc: guix-devel@gnu.org =E5=AE=8B=E6=96=87=E6=AD=A6 (2015-12-02 16:38 +0300) wrote: > +(define (environment-variables->environment-file vars) > + "Return a file for pam_env(8) that contains environment variables VARS= ." > + (apply mixed-text-file "environment" > + (fold-right (lambda (pair result) > + (cons* (car pair) "=3D" (cdr pair) "\n" result)) > + '() vars))) Hm, car and cdr. Wouldn't it be clearer to do it like this: (map (match-lambda ((name . value) (string-append name "=3D" value "\n"))) vars) --=20 Alex