unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Dmitry Bogatov <KAction@gnu.org>
Cc: Guile User <guile-user@gnu.org>
Subject: Re: [ANN] guile-bash
Date: Thu, 12 Feb 2015 23:39:52 +0100	[thread overview]
Message-ID: <874mqqlpon.fsf@gnu.org> (raw)
In-Reply-To: <20150207224540.GA32691@self> (Dmitry Bogatov's message of "Sun,  8 Feb 2015 01:45:41 +0300")

Dmitry Bogatov <KAction@gnu.org> skribis:

> I would like to anounce my library, guile-bash.  With it, you can write
> your bash functions in Scheme, like this:
>
> (use-modules (gnu bash))
> (define-bash-function (dtach-start-emacs)
>   (unless (file-exists? "/tmp/emacs.dtach")
>     #$[dtach -n /tmp/emacs.dtach emacs]))

This looks neat!

[...]

> Now you should have `dtach-start-emacs` function availiable.  To get
> overview of what is availiable, see lisp/gnu/bash.scm Functions defined
> with `define-ffi` and `define-public` are of interest.

The (system ffi) module looks interesting.  It would be nice to
integrate some of these ideas it into Guile proper eventually.

> About reader macro.  To get variable value, write `#$HOME`, to set
>
> (set! #$HOME).
>
> #$[echo foo] is just eval
> #$(echo foo) captures output.

Cool.  Just one nit: #$ is also used by Guix, so it would be nice if
guile-bash would use something else, in the interest of composability.
;-)

Random comments:

  • lisp/ is conventionally the directory containing elisp code; for
    Guile code, some of us use module/ or modules/ or just the
    top-level directory.

  • There are places with unnecessarily repeated #:export or
    ‘use-modules’ forms that look verbose to me.

Thanks for the nice hack!

Ludo’.



      reply	other threads:[~2015-02-12 22:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-07 22:45 [ANN] guile-bash Dmitry Bogatov
2015-02-12 22:39 ` Ludovic Courtès [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://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mqqlpon.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=KAction@gnu.org \
    --cc=guile-user@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.
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).