guile-devel
[Top][All Lists]
Advanced

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

[PATCH] Add ',run' and ',!'


From: Nikita Karetnikov
Subject: [PATCH] Add ',run' and ',!'
Date: Thu, 11 Apr 2013 08:05:20 +0400

There is a neat command-line option in GHCi (i.e., :!).  It allows to
run programs from the interpreter.  For example:

$ ghci
Prelude> :! echo foo
foo

I decided to add a similar option to Guile.  I've attached my attempt.

I wasn't sure which version (branch) to use; I used 2.0.7.  Also, I
didn't bother to really check the code; just tested it a couple of
times.  I'll do it before I send the output of 'git format-patch'.  By
the way, should I assign my copyright prior to that?  (I'm OK with
that, but it may take a while.  And where can I get the form?)

It seems to work:

scheme@(guile-user)> ,run echo foo
foo
scheme@(guile-user)> ,run ls -lh

[...]

scheme@(guile-user)> ,! echo bar baz 42
bar baz 42

Also, I'll try to handle the following cases more gently:

scheme@(guile-user)> ,!
While executing meta-command:
ERROR: Wrong number of arguments to #<procedure 996b440 at 
system/repl/command.scm:931:0 (repl command . args)>

scheme@(guile-user)> ,! foo
While executing meta-command:
ERROR: In procedure system*: No such file or directory

So, what do you think?

Attachment: run.diff
Description: Text Data

Attachment: pgpvjn1OtnlhP.pgp
Description: PGP signature


reply via email to

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