From: Ricardo Wurmus <rekado@elephly.net>
To: Olivier Dion <olivier.dion@polymtl.ca>
Cc: gwl-devel@gnu.org
Subject: Re: Guile code snippet
Date: Wed, 20 Apr 2022 11:47:36 +0200 [thread overview]
Message-ID: <87r15srshn.fsf@elephly.net> (raw)
In-Reply-To: <87h76oo26s.fsf@laura>
Hi Olivier,
> Is there an easy way to do code snippet in Guile? I currently do:
> # { guile snippet.scm }
The manual introduces how to use code snippets:
https://guixwl.org/manual/html_node/Code-Snippets.html
This
# { … }
is just a shorthand for
# /bin/bash -c { … }
You can use any interpreter after the hash, e.g.
# /bin/guile … { … }
But you could just as well provide a quoted Scheme expression or an
actual G-expression right there, e.g.
(procedure
`(call-with-output-file ,(first outputs)
(lambda (port)
(format port "Hello, world!~%"))))
--
Ricardo
next prev parent reply other threads:[~2022-04-20 9:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 3:37 Guile code snippet Olivier Dion via
2022-04-20 9:47 ` Ricardo Wurmus [this message]
2022-04-20 16:13 ` Olivier Dion via
2022-04-20 16:26 ` Ricardo Wurmus
2022-04-20 16:35 ` Olivier Dion via
2022-04-20 21:21 ` Ricardo Wurmus
2022-04-21 16:30 ` Olivier Dion via
2022-04-21 18:14 ` Ricardo Wurmus
2022-04-21 20:08 ` Olivier Dion via
2022-04-21 20:46 ` Ricardo Wurmus
2022-04-21 22:02 ` Olivier Dion via
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://www.guixwl.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r15srshn.fsf@elephly.net \
--to=rekado@elephly.net \
--cc=gwl-devel@gnu.org \
--cc=olivier.dion@polymtl.ca \
/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.
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).