From: Tanguy Le Carrour <tanguy@bioneland.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix <guix-devel@gnu.org>, Diego Nicola Barbato <dnbarbato@posteo.de>
Subject: Re: SLiM graphical login manager and keyboard layout
Date: Wed, 23 Oct 2019 09:32:40 +0200 [thread overview]
Message-ID: <20191023073240.3kmd7yoobgssoq6u@rafflesia> (raw)
In-Reply-To: <871rv53qkp.fsf@gnu.org>
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 <tanguy@bioneland.org> skribis:
> > Le 10/18, Diego Nicola Barbato a écrit :
> >> Tanguy Le Carrour <tanguy@bioneland.org> 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
prev parent reply other threads:[~2019-10-23 7:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-18 12:33 SLiM graphical login manager and keyboard layout Tanguy Le Carrour
2019-10-18 14:40 ` Joshua Branson
2019-10-18 15:36 ` Tanguy Le Carrour
2019-10-18 14:55 ` Alex Griffin
2019-10-18 15:57 ` Tanguy Le Carrour
2019-10-18 16:03 ` Diego Nicola Barbato
2019-10-18 16:11 ` Tanguy Le Carrour
2019-10-18 16:57 ` Diego Nicola Barbato
2019-10-21 7:24 ` Tanguy Le Carrour
2019-10-22 12:36 ` Ludovic Courtès
2019-10-23 7:32 ` Tanguy Le Carrour [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191023073240.3kmd7yoobgssoq6u@rafflesia \
--to=tanguy@bioneland.org \
--cc=dnbarbato@posteo.de \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).