* module/ice-9/command-line.scm (*usage*): Make usage of capitalization
and sentences consistent (lower-case and semicolons, as in ls
--help).
Be less specific about languages (Scheme is the default but not the
only language).
Document --language.
(load/lang, eval-string/lang): New helpers.
(compile-shell-switches): Parse a --language argument, and use it to
set (current-language).
* module/ice-9/boot-9.scm (current-language): New parameter.
* module/system/base/language.scm (*current-language*): Pull fluid from
parameter.
(current-language): Now a re-exported parameter.
* doc/ref/compiler.texi: Update reference from *current-language* fluid
to current-language parameter.
* module/system/base/compile.scm (compile-and-load):
* module/ice-9/top-repl.scm (top-repl): Default to the current language,
not to Scheme.
* module/ice-9/eval-string.scm:
* module/system/base/language.scm:
* module/system/repl/command.scm:
* module/system/repl/repl.scm: Update to use current-language parameter
and parameterize.
* module/ice-9/boot-9.scm (make-parameter): Add a docstring.
(fluid->parameter): New interface. Use it when turning port fluids
into parameters.
* doc/ref/api-scheduling.texi (Parameters): Deffn instead of defun for
make-parameter documentation. Add docs for fluid->parameter.
* module/ice-9/psyntax.scm (include): Like `load', interpret relative
paths as being relative to the file that does the `include'.
* doc/ref/api-evaluation.texi: Update docs.
* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): Fix the error message if
the value was not a struct.
* module/system/base/compile.scm (find-language-joint): Default to
joining at the target language.
(default-language-joiner): Allow sequences of one compiled expression
to pass through. Otherwise error as before.
(read-and-parse): New helper; actually parses.
(read-and-compile): Use read-and-parse, and fall back to
default-language-joiner.
Thanks to Nala Ginrut for the report.
* module/system/base/compile.scm (read-and-compile): Close the input
port after we read all of its data. Perhaps this cleans up some NFS
ghosts that David Pirotte was seeing.
* libguile/load.c (scm_primitive_load_path): If the second argument is a
procedure, call it like a thunk.
* doc/ref/api-evaluation.texi (Load Paths): Update docs.
* module/ice-9/boot-9.scm (resolve-interface): Use `unless'.
(try-module-autoload): Use the new primitive-load-path to detect
failure to find an appropriate file. Fixes a bug reported by Diogo
F. S. Ramos. Thanks to Noah Lavine for tracking it down.
* module/system/vm/trace.scm (build-prefix): New helper.
(print-application, print-return): Use the helper.
(trace-calls-to-procedure, trace-calls-in-procedure):
(trace-instructions-in-procedure, call-with-trace): Add #:max-indent
argument, defaulting to the terminal width less 40 characters.
* doc/ref/scheme-using.texi: Update `trace' docs.
Based on a patch by Nala Ginrut.
* module/language/tree-il/peval.scm (peval): Gensyms use whitespace as
an infix, not a dash. Helps gensym?-like procedures like those in the
unused lexical analysis.
* module/ice-9/peg.scm: rename 'peg-sexp-compile' to
'compile-peg-pattern'
* module/ice-9/peg/codegen.scm: same
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
* module/ice-9/peg.scm: rename 'define-grammar' to
'define-peg-string-patterns'
* module/ice-9/peg/string-peg.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.bench: same
* test-suite/tests/peg.test: same
* module/ice-9/peg.scm: rename 'define-nonterm' to 'define-peg-pattern'
* module/ice-9/peg/using-parsers.scm: same
* module/ice-9/peg/string-peg.scm: same
* test-suite/tests/peg.test: same
* doc/ref/api-peg.texi: same
* module/ice-9/peg.scm: rename 'peg-parse' to 'match-pattern'
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.test: same
* test-suite/tests/peg.bench: same
* doc/ref/api-peg.texi: rename 'peg-match' to 'search-for-pattern'
* module/ice-9/peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* test-suite/tests/peg.test: same
module/ice-9/peg/string-peg.scm: update S-expression generators to use the
new *, +, ?, followed-by, and not-followed-by forms.
module/ice-9/peg/codegen.scm: remove the 'body' form in the PEG s-expression
representation.
* module/ice-9/peg.scm: move code out of here
* module/ice-9/peg/match-records.scm: remove this file
* module/ice-9/peg/using-parsers.scm: make a new module with utilities for
using parsers. It contains the code from both peg.scm and match-records.scm
* module/ice-9/peg/string-peg.scm: update to use new module
* module/ice-9/peg/codegen.scm: Make the PEG syntax extensible, and
move most of the current code generators to the new interface
* doc/ref/api-peg.texi: Document PEG extensions in the PEG Internals
section of the manual
* module/ice-9/peg/codegen.scm: peg-sexp-compile no longer knows about
string PEGs
* module/ice-9/peg.scm: add a new function peg-extended-compile that
calls peg-sexp-compile or peg-string-compile on its argument as
appropriate
* module/ice-9/peg/string-peg.scm: remove define-nonterm and make a simpler
macro called `define-sexp-parser' to make the PEG grammar
* module/ice-9/peg.scm: move define-nonterm macro to this file
* module/ice-9/peg/codegen.scm: move code to wrap a parser result nicely to
this file, under name `wrap-parser-for-users'
* module/ice-9/peg.scm (cg-generic-ret): Remove unused for-syntax
argument.
(peg-sexp-compile): Take the pattern as syntax directly, and use
syntax-case to destructure it and dispatch to the code generators.
(cg-and, cg-and-int, cg-or, cg-or-int): Refactor to operate on syntax
instead of on s-expressions.
(cg-body): Likewise; though this was a larger refactor.
(define-nonterm, peg-match): Adapt to peg-sexp-compile calling
convention change.
(peg-string-compile): Likewise, and just take the grammar as a syntax
object.
* module/ice-9/peg.scm (cg-generic-lambda, cggl): Remove these helpers,
they are no longer needed.
(cg-generic-ret): Remove optimization for particular cg- routines, as
it's no longer needed.