guile-user
[Top][All Lists]
Advanced

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

Re: command line args to guile


From: Paul Jarc
Subject: Re: command line args to guile
Date: Fri, 07 Mar 2003 13:12:44 -0500
User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 (i686-pc-linux-gnu)

Rick Taube <address@hidden> wrote:
> when i do guile --help i dont see it. id like to do something like:
>
> % guile -c '(define foo 1)' -l "bar.scm" -l "bif.scm"
> guile> foo
> 1

You can do this:
$ guile -c '(define foo 1) (load "bar.scm") (load "bif.scm")'
But I don't know how to start the REPL from Scheme code.

If your shell does process substitution, you could avoid -c, so that
guile will start the REPL as usual:
$ guile -l <(echo '(define foo 1)') -l bar.scm -l bif.scm

> I then tried working with the -e option that takes a function but i
> guess i do not understand
> how to notate a lambda expr from the shell:
>
> % guile -e '(lambda args (display args))'
> ERROR: Unbound variable: #{\(lambda\ args\ \(display\ args\)\)}#

-e takes a *name* of an existing function, not an expression that
evaluates to a function.  It's not what you want here.  This works:
$ guile -c '(display (program-arguments)) (newline)'
(guile)

And this will print the arguments, and then start the REPL:
$ guile -e display -- args ...
(guile args ...)guile> 


paul




reply via email to

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