* module/language/tree-il/peval.scm (peval): Fold (values
'singly-valued-expression) to 'singly-valued-expression in contexts
that expect multiple values, in addition to those that expect single
values.
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Fix
miscompilation of `values' in a push context with RA.
* test-suite/tests/tree-il.test: Add low-level test for this
miscompilation.
* module/ice-9/boot-9.scm (current-filename): Canonicalize the path, so
that the result is independent of the current directory, and so
that `dirname' can traverse up the file system, as in the
add-to-load-path example.
(add-to-path): Remove. The eval-when semantics make this macro too
tricky to explain -- people will start using it on other path-like
things, in lexical contours, whereas it only really makes sense with
load-like paths at the toplevel.
* doc/ref/api-evaluation.texi (Loading): Fix link to load-with-path
docs, and remove add-to-path docs.
* module/ice-9/boot-9.scm (syntax-local-binding): New binding.
* module/ice-9/psyntax.scm: Locally define a fluid that holds the
"transformer environment". with-transformer-environment calls a
procedure with the transformer environment, or raises an error if
called outside the extent of a transformer. Bind
transformer-environment in expand-macro.
(resolve-identifier): Backport this helper from master.
(syntax-local-binding): New procedure to return binding information of
a bound identifier (a lexical, macro, a pattern variable, a displaced
lexical, a global, or some other form).
* module/ice-9/psyntax-pp.scm: Regenerate.
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Add docs for
syntax-local-binding, and syntax-source, and move some other
descriptions to this new section.
* module/language/glil/compile-assembly.scm (scheme-list?): New
predicate, like `list?' but requires that the last cdr must be '(),
not #nil.
(dump-object, dump-constants): Use `list' opcode to create a list only
if it is terminated by '(). If it's terminated by #nil, we must use
the more general `cons' opcode.
* module/ice-9/ftw.scm (errno-if-exception): New macro.
(file-system-fold): Add an `error' parameter. Wrap `opendir' and STAT
calls in `errno-if-exception' and call ERROR when appropriate.
(file-system-tree): Provide an `error' procedure. Return #f when
FILE-NAME is unreadable.
(scandir): Provide an `error' procedure.
* test-suite/tests/ftw.test (%top-builddir): New variable.
(make-file-tree, delete-file-tree): New procedures.
(with-file-tree): New macro.
("file-system-fold"): Update tests to add an `error' procedure.
["ENOENT", "EACCES", "dangling symlink and lstat", "dangling symlink
and stat"]: New tests.
("file-system-tree")["ENOENT"]: New test.
("scandir")["EACCES"]: New test.
* doc/ref/misc-modules.texi (File Tree Walk): Update `file-system-fold'
documentation.
* module/ice-9/psyntax.scm (define-syntax-parameter): New toplevel form.
Will be used to implement syntax parameters, following Barzilay,
Culpepper, and Flatt's 2011 SFP workshop paper, "Keeping it Clean with
syntax-parameterize". Adds a new binding type and definition form.
Conflicts:
module/ice-9/psyntax.scm
* module/ice-9/psyntax.scm (define-expansion-constructors)[begin-form]:
Emit a syntax-violation error for empty sequences when
--disable-deprecated.
* test-suite/tests/syntax.test (pass-if-syntax-error): Fix typo in error
message.
* doc/ref/api-compound.texi (VHashes): Add missing `init' parameter in
documentation for vhash-fold and vhash-fold-right, and also improve
description.
* module/ice-9/vlist.scm (vhash-fold, vhash-fold-right): Rename formal
parameter `seed' to `init', to match documentation. Improve
docstrings.
* module/web/http.scm ("Cache-Control"): Write string values using the
default val writer, to get quoting correct.
* test-suite/tests/web-http.test (pass-if-round-trip): New helper.
("general headers"): Check that cache-extensions round trip properly.
* module/web/http.scm ("Cache-Control"): Value for `max-stale' is
optional. Strict validation for value-less directives (`no-store',
etc.). String values optional for "cache-extension" directives.
* test-suite/tests/web-http.test: Value for `max-stale' is optional.
* doc/ref/api-control.texi (begin): Update to distinguish between
splicing begin and sequencing begin.
* module/ice-9/psyntax.scm (expand-expr): Add a back-compatibility shim
for `(begin)'.
* module/ice-9/psyntax-pp.scm: Regenerate.
* test-suite/tests/syntax.test: Update to run illegal (begin) test only
if we are not including deprecated features.
* module/language/tree-il/peval.scm (singly-valued-expression?): New
helper.
(truncate-values): Use the helper.
(make-operand): Minor refactor.
(set-operand-residual-value!): Try to undo the effects of (values
FOO), if the continuation will check itself for the correct number of
values.
(peval): Fold helpers into fold-constant. Add a constant-expression?
case for (values FOO). Add a new context: "values", for contexts in
which multiple values are allowed, either because of being in a tail
context relative to a function, or because of let-values. "value" is
now for single values. Don't visit operands for "values", as their
binding form truncates to one value. Add a case to fold (values ...)
forms. Fix folding of (lambda), to process the cases in values
context instead of tail context (which could have been "value", which
would cause the procedure to truncate).
* module/ice-9/ftw.scm (file-system-fold): Fix reference to STAT instead
of ST.
(scandir)[enter?]: Change the argument name to `dir', to avoid
confusion.
[skip]: Return RESULT, not #f.
* module/ice-9/ftw.scm (scandir)[leaf]: Only add NAME when RESULT is a
pair.
[down]: Ignore RESULT.
Start with #f instead of the empty list.
* test-suite/tests/ftw.test ("scandir")["flat file"]: New test.
* doc/ref/misc-modules.texi (File Tree Walk): Update `scandir'
documentation accordingly.
* module/ice-9/deprecated.scm: Add alias for $expt. $expt was removed
in commit 6fc4d0124d but no deprecated
alias was added in ad79736c68 like for
all the other deprecated $sin, $cos, ... functions.
Suggested by Nala Ginrut <nalaginrut@gmail.com>.
* module/ice-9/ftw.scm (scandir): New procedure.
* test-suite/tests/ftw.test ("scandir"): New test prefix.
* doc/ref/misc-modules.texi (File Tree Walk): Document `scandir'.
* module/ice-9/ftw.scm (file-system-fold): Add an optional `stat'
parameter. Use it instead of `lstat'. Handle the case where (STAT child)
fails.
(file-system-tree): Likewise, and pass it to `file-system-fold'.
* doc/ref/misc-modules.texi (File Tree Walk): Update the documentation
of these functions.
* module/ice-9/ftw.scm (file-system-fold, file-system-tree): New
procedures.
* test-suite/tests/ftw.test (%top-srcdir, %test-dir): New variables.
("file-system-fold", "file-system-tree"): New test prefixes.
* doc/ref/misc-modules.texi (File Tree Walk): Document
`file-system-tree' and `file-system-fold'.
* module/ice-9/session.scm: #:keyword-ify the define-module form, and
export apropos-hook.
(apropos-hook): New hook.
(apropos, apropos-fold): Run the apropos-hook.
* libguile/ports.c (scm_init_ports): Export the port fluids to Scheme,
temporarily.
* module/ice-9/boot-9.scm (fluid->parameter): Turn `current-input-port'
et al into srfi-39 parameters, backed by the exported fluids, then
remove the fluids from the guile module.
(%cond-expand-features): Add srfi-39.
* module/srfi/srfi-39.scm: Re-export features from boot-9.
* test-suite/tests/parameters.test: Add tests.
Reported by Cédric Cellier <rixed@happyleptic.org>.
* module/language/tree-il/peval.scm (truncate-values): New procedure.
(make-operand): Call `truncate-values' SOURCE.
* test-suite/tests/tree-il.test ("partial evaluation"): New tests for
multiple value truncation.