Dmitry Bogatov <[email protected]> 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