From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tanguy Le Carrour Subject: Re: SLiM graphical login manager and keyboard layout Date: Wed, 23 Oct 2019 09:32:40 +0200 Message-ID: <20191023073240.3kmd7yoobgssoq6u@rafflesia> References: <20191018123345.sxoawlfothe2tx3d@rafflesia> <87eeza2g7l.fsf@GlaDOS.home> <20191018161122.2sryulubzaiozfto@rafflesia> <87a79y2dqd.fsf@GlaDOS.home> <20191021072419.upbsh4jvvcftlbhk@rafflesia> <871rv53qkp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42485) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNB8Q-0003UY-A4 for guix-devel@gnu.org; Wed, 23 Oct 2019 03:32:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNB8P-0002sQ-3T for guix-devel@gnu.org; Wed, 23 Oct 2019 03:32:46 -0400 Content-Disposition: inline In-Reply-To: <871rv53qkp.fsf@gnu.org> 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" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Guix , Diego Nicola Barbato Hi Ludovic, Thanks for taking the time to clarify all this! … but I have to confess that I had to read it several times! ^_^' Le 10/22, Ludovic Courtès a écrit : > Tanguy Le Carrour skribis: > > Le 10/18, Diego Nicola Barbato a écrit : > >> Tanguy Le Carrour writes: > >> > (service slim-service-type > >> > (slim-configuration > >> > (xorg-configuration > >> > (xorg-configuration > >> > (keyboard-layout keyboard-layout)))))) > >> > > >> > > >> > I don't understand the "double" `xorg-configuration`, though! ^_^' > >> > >> The outer 'xorg-configuration' is a field of the 'slim-configuration' > >> data type. The inner 'xorg-configuration' is itself a data type > >> representing the Xorg configuration (with its 'keyboard-layout' field > >> set to the value of 'keyboard-layout'). > > > > Thanks for the clarification! > > All of this LISP/Scheme/Guile is still a bit magical to me! How does one makes > > the difference between field assignment and data type "instanciation"? ^_^' > > How does the interpreter know that the same "word" means two different > > things?! > > There are several rules. The most important one is lexical scope: when > you see an identifier, it always refers to the binding in its lexical > scope. So there are no bad surprises: > > (let ((* +) (x 42)) ;here ‘+’ is a “free variable”—i.e., not in scope > (let ((x 7)) > (* x x))) > => 14 So a variable name can **really** be anything! "*", "+", "specification->package"… I think I'll get used to it! :-) > Then there are “special forms” (macros) that can introduce new bindings > like ‘let’. Macros are always* “referentially transparent” (or > “hygienic”), which means notably that they only introduce bindings that > you explicitly typed in, and they cannot capture bindings that you did > not explicitly provide them as an argument: > > (let ((x 3)) > ;; Here ‘x’ is defined. > …) > > (operating-system > (keyboard-layout …) > ;; Here ‘keyboard-layout’ is defined, because ‘operating-system’ > ;; expands to something like: > ;; > ;; (let* ((keyboard-layout …) (next-field …) …) …) > ) > > The rules are unambiguous. I understand it takes some getting used to > it, but the general idea is that scoping behaves “like you’d expect.” OK… this one I'll have to read again! … maybe even sleep on it… several nights! ^_^' > HTH! Definitivly! Thanks! -- Tanguy