diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-04-06 13:06:36 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-04-06 13:07:01 +0200 |
commit | 004094d378182d8343398c0bec817114c06ea933 (patch) | |
tree | b362b43dd47c760e04b1214f050805c2a2c3a3fa /doc | |
parent | 66750b78c7f67e91d1e01a4926e2e85a12f2b16a (diff) | |
download | guile-004094d378182d8343398c0bec817114c06ea933.tar.gz |
doc: Document `--language'.
* doc/ref/guile-invoke.texi (Command-line Options): Document `--language'.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ref/guile-invoke.texi | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/ref/guile-invoke.texi b/doc/ref/guile-invoke.texi index 866bf1de1..29f3c93c8 100644 --- a/doc/ref/guile-invoke.texi +++ b/doc/ref/guile-invoke.texi @@ -208,6 +208,35 @@ Treat the auto-compilation cache as invalid, forcing recompilation. @item --no-auto-compile Disable automatic source file compilation. +@vnew{2.0.8} + +@item --language=@var{lang} +For the remainder of the command line arguments, assume that files +mentioned with @code{-l} and expressions passed with @code{-c} are +written in @var{lang}. @var{lang} must be the name of one of the +languages supported by the compiler (@pxref{Compiler Tower}). When run +interactively, set the REPL's language to @var{lang} (@pxref{Using Guile +Interactively}). + +The default language is @code{scheme}; other interesting values include +@code{elisp} (for Emacs Lisp), and @code{ecmascript}. + +The example below shows the evaluation of expressions in Scheme, Emacs +Lisp, and ECMAScript: + +@example +guile -c "(apply + '(1 2))" +guile --language=elisp -c "(= (funcall (symbol-function '+) 1 2) 3)" +guile --language=ecmascript -c '(function (x) @{ return x * x; @})(2);' +@end example + +To load a file written in Scheme and one written in Emacs Lisp, and then +start a Scheme REPL, type: + +@example +guile -l foo.scm --language=elisp -l foo.el --language=scheme +@end example + @vnew{2.0} @item -h@r{, }--help |