From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/3] services: Add 'session-environment-service'. Date: Fri, 04 Dec 2015 15:29:31 +0100 Message-ID: <87mvtqjnhw.fsf@gnu.org> References: <1449063511-689-1-git-send-email-iyzsong@gmail.com> <87mvtsheoy.fsf@gmail.com> <87oae7920f.fsf@member.fsf.org> 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]:58310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4yWs-00022m-Vv for guix-devel@gnu.org; Fri, 04 Dec 2015 17:08:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4yWs-0005TV-4T for guix-devel@gnu.org; Fri, 04 Dec 2015 17:08:38 -0500 In-Reply-To: <87oae7920f.fsf@member.fsf.org> (=?utf-8?B?IuWui+aWh+atpiIn?= =?utf-8?B?cw==?= message of "Thu, 03 Dec 2015 19:59:12 +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, Alex Kost iyzsong@member.fsf.org (=E5=AE=8B=E6=96=87=E6=AD=A6) skribis: > Alex Kost writes: > >> =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 VA= RS." >>> + (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) > Yes, match-lambda is more clear, thanks! Indeed. :-) > From 0ce1986d4cfca3d40bed4aaf93942cf9caaefb60 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?=3DE5=3DAE=3D8B=3DE6=3D96=3D87=3DE6=3DAD=3DA6?=3D > Date: Wed, 2 Dec 2015 19:59:29 +0800 > Subject: [PATCH] services: Add 'session-environment-service'. > > * gnu/services/base.scm (session-environment-service): New procedure. > (session-environment-service-type): New variable. > (environment-variables->environment-file): New procedure. LGTM, thanks! Ludo=E2=80=99.