guile-user
[Top][All Lists]
Advanced

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

Re: [ANN] guile-bash


From: Ludovic Courtès
Subject: Re: [ANN] guile-bash
Date: Thu, 12 Feb 2015 23:39:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Dmitry Bogatov <address@hidden> 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 via email to

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