guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practices for processing s-expressions representing configurati


From: Ludovic Courtès
Subject: Re: Best practices for processing s-expressions representing configurations/DSLs
Date: Tue, 18 Dec 2018 17:50:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello,

Stephen Scheck <address@hidden> skribis:

> When representing application configurations or DSLs as s-expressions, what
> are common or best strategies for processing them? For example, here's an
> excerpt I found of the Guix package definition DSL to study as a prototype:
>
>     (package
>       (name "hello")
>       (version "2.10")
>       (build-system gnu-build-system)
>       (arguments '(#:configure-flags '("--enable-silent-rules")))
>       (inputs `(("gawk" ,gawk)))
>       (synopsis "Hello, GNU world: An example GNU package")
>       (description "Guess what GNU Hello prints!")
>       (home-page "http://www.gnu.org/software/hello/";)
>       (license gpl3+))
>
> Would this just be executed directly within the equivalent of a regular
> Guile REPL (with the Guix extensions loaded, of course) ? Is each "key"
> (e.g. "name" or "build-system") just a function call?

The expression above expands to a (make-struct <package> …) call, which
instantiates a record (also called a structure in some languages.)

The article at <https://arxiv.org/pdf/1305.4584v1.pdf> explains it in
more detail.

HTH!

Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]