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: Rick Taube
Subject: Re: command line args to guile
Date: Fri, 7 Mar 2003 13:21:56 -0600

thank you for the nice workaround, unfortunately my shell does not do the < substution so i cant use the method you suggest. Guile could really use an additional switch that evals an expr but does not quit! I guess ill have to generate a file with my expressions and then -l that.



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

id like to do something like:

% guile -c '(define foo 1)' -l "bar.scm" -l "bif.scm"
guile> foo
1

On Friday, Mar 7, 2003, at 12:12 America/Chicago, Paul Jarc wrote:

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


_______________________________________________
Guile-user mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/guile-user






reply via email to

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