From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.user Subject: Re: Best practices for processing s-expressions representing configurations/DSLs Date: Tue, 18 Dec 2018 17:50:46 +0100 Message-ID: <87tvjaeq3d.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1545151849 32269 195.159.176.226 (18 Dec 2018 16:50:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Dec 2018 16:50:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 18 17:50:45 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZIZx-0008HR-Cn for guile-user@m.gmane.org; Tue, 18 Dec 2018 17:50:45 +0100 Original-Received: from localhost ([::1]:55144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZIc3-0002Hk-Oc for guile-user@m.gmane.org; Tue, 18 Dec 2018 11:52:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZIbb-0002HY-WE for guile-user@gnu.org; Tue, 18 Dec 2018 11:52:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZIbX-0001JG-TI for guile-user@gnu.org; Tue, 18 Dec 2018 11:52:28 -0500 Original-Received: from [195.159.176.226] (port=44584 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZIbU-0001Dt-GC for guile-user@gnu.org; Tue, 18 Dec 2018 11:52:22 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gZIZG-0007Pr-SW for guile-user@gnu.org; Tue, 18 Dec 2018 17:50:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@blaine.gmane.org X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 Frimaire an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Cancel-Lock: sha1:z1OxOKLmZkeJ9E7LhDdDAvBEnlw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15119 Archived-At: Hello, Stephen Scheck 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 …) call, which instantiates a record (also called a structure in some languages.) The article at explains it in more detail. HTH! Ludo’.