* module/language/elisp/bindings.scm:
* module/language/elisp/compile-tree-il.scm:
* module/language/elisp/lexer.scm:
* module/language/elisp/parser.scm:
* module/language/elisp/runtime.scm:
* module/language/elisp/runtime/function-slot.scm:
* module/language/elisp/runtime/macro-slot.scm: Ensure that all
top-level forms and comments are separated by exactly one newline.
Remove blank lines in most procedure bodies. Delete trailing
whitespace.
argument to Guile's `member' and `assoc' functions has a different expected
arity.
* module/rnrs/lists.scm (memp, assp): Wrap the predicate function with a
two-argument wrapper before calling Guile's underlying implemenation.
* test-suite/Makefile.am: Add test-suite/tests/r6rs-lists.test to
SCM_TESTS.
* test-suite/tests/r6rs-lists.test: New file.
`for-each' and `map' implementations do not operate on lists and vectors
interchangeably.
* module/rnrs/base.scm (vector-for-each, vector-map): New functions.
* test-suite/Makefile.am: Add test-suite/tests/r6rs-base.test to SCM_TESTS.
* test-suite/tests/r6rs-base.test: New file.
* module/system/foreign.scm (parse-c-struct): Update use of
`pointer->bytevector' to the new API.
* test-suite/tests/foreign.test ("structs"): New test prefix.
* doc/ref/api-foreign.texi (Foreign Types): Remove bits about typed
foreign pointers. Add `void'.
(Foreign Variables): Update the doc of `dynamic-pointer' and the
`numptob' example. Remove `foreign-set!' and `foreign-ref'. Add
`pointer-address', `make-pointer', `%null-pointer', and
`null-pointer?'
(Void Pointers and Byte Access): Make it clear that wrapped pointers
are untyped. Remove `void' from here. Replace `foreign->bytevector'
and `bytevector->foreign' by `pointer->bytevector' and
`bytevector->pointer'. Add `dereference-pointer' and the rest of the
`numptob' example.
(Dynamic FFI): Update examples. Remove `%null-pointer' from here.
* libguile/dynl.c (scm_dynamic_pointer): Update docstring.
* libguile/foreign.c (scm_dereference_pointer,
scm_pointer_to_bytevector): Likewise.
* module/system/foreign.scm (null-pointer?): Add docstring.
* am/guilec (install-data-hook): Remove.
(guile_install_go_files): New variable.
($(guile_install_go_files)): New dependency.
* libguile/load.c (compiled_is_fresh): Check for ordering of STAT_SOURCE
and STAT_COMPILED, not equality.
* module/ice-9/boot-9.scm (load): Ditto.
* module/system/base/compile.scm (call-with-output-file/atomic): Don't
set the timestamp of TEMPLATE.
* module/ice-9/debug.scm: Gut, though we keep the module around for code
Out There that uses it.
* module/ice-9/top-repl.scm (top-repl): Don't import (ice-9 debug)
* module/ice-9/debugger/commands.scm:
* module/ice-9/debugging/trace.scm:
* module/ice-9/emacs.scm: Remove ice-9 debug includes.
* module/system/repl/error-handling.scm (call-with-error-handling):
Previous post-error changed to "report"; now "catch", the default,
doesn't re-print the error.
Guile implements this library in terms of SRFI-69, which is a bit vague on
the arity of hash functions, whereas `(rnrs hashtables)' explicitly
specifies unary ones.
* module/rnrs/hashtables.scm (wrap-hash-function): Assume SRFI-69 will pass
the table capacity as the second argument; return the result of proc
modulo the capacity.
* test-suite/tests/r6rs-hashtables.test (make-hashtable): New test case for
hash functions that return large values.
* module/ice-9/buffered-input.scm (make-buffered-input-port): Instead of
always returning EOF once EOF is seen once, call the producer again.
Allows Ctrl-D to cause one EOF at the REPL, returning once from a
recursive edit, but input continues normally. Thanks to Andrew
Bagdanov for a clue that led to the fix.
* module/Makefile.am (ice-9/psyntax-pp.scm.gen): No longer automatically
regenerate psyntax-pp.scm, as the gensym dance is getting too
complicated. Instead when you change psyntax.scm now you should make
ice-9/psyntax-pp.scm.gen.
* module/system/repl/repl.scm (run-repl): Run the thunk in a stack in a
prompt, similar to the default prompt. Gives proper backtraces.
* module/system/repl/error-handling.scm (call-with-error-handling):
Narrow one more outer frame, for the %start-stack thunk invocation.
* module/ice-9/boot-9.scm (%start-stack): Reindent.
* module/system/repl/common.scm: Use (ice-9 history). Turns on value
history by default.
(repl-default-options): Expand the format of options to include an
optional value transformer, run when setting a value. Add prompt and
value-history options.
(repl-prepare-eval-thunk): Use repl-option-ref.
(repl-option-ref): Error if the option is unknown.
(repl-option-set!, repl-default-option-set!): Error if the option is
unknown. Pass the val through the transformer procedure.
(repl-default-prompt-set!): Just use repl-default-option-set!.
* module/system/repl/command.scm (option): Update for the new options
format.
* module/system/repl/common.scm (repl-default-options): Heap-allocate
the repl-default-options, to avoid mutating a literal.
(make-repl): Copy repl-default-options.
* module/system/repl/repl.scm (abort-on-error): New helper.
(run-repl): Don't enter the debugger during parsing or compilation of
a repl expression. If you want to debug compilation, run compilation
from the repl, not as part of the repl.
* module/system/repl/debug.scm (print-locals): Run the before-print-hook
on the values, so we can hook into (ice-9 history) if available. Don't
bother printing binding indices. Give a little per-line-prefix.
* module/system/repl/command.scm (read-command): Remove a pk.
* module/system/repl/repl.scm (run-repl): Export. Use % and abort to
implement the prompt.
* module/system/repl/debug.scm: New file, defines a data type to hold
state for a debugger stack, and some helper procedures to print the
stack or print a frame. Most pieces are from (system vm debug).
* module/system/repl/error-handling.scm: New file, implements
call-with-error-handling and with-error-handling, and instead of going
into a debugger, we go into a recursive repl that happens to have
debugging information. Will be removing the old debugger from (system
vm debug) shortly.
* module/Makefile.am (SYSTEM_SOURCES): Add error-handling and debug scm
files.
* module/system/repl/repl.scm (prompting-meta-read): Better error
handling -- we don't want to go into a debugger when reading a
command.
(start-repl): Add #:debug keyword argument, and just dispatch to
run-repl.
(run-repl): New function, with the guts of the old start-repl. Added a
prompt, to which a throw to 'quit will abort.
* module/system/repl/common.scm (repl-prepare-eval-thunk): New
helper. In the future we will use this to not enter the debugger on
errors that happen at compile time.
(repl-eval): Use repl-prepare-eval-thunk.
(repl-print): Run the before-print-hook when printing a value.
* module/system/repl/command.scm (*command-table*): Move `option' to the
`system' group. Move `trace' to the `profile' group. Add `debug' and
`inspect' groups.
(command-abbrevs): Rename from command-abbrev, and allow multiple
abbreviations.
(display-group): Fix the case where abbrev? was #f.
(display-summary): Fix alignment of the command and
abbreviations. Allow multiple abbreviations.
(read-command): Rename from read-datum, and have better error
handling.
(meta-command): Better error handling.
(define-meta-command): Better error handling.
(help, show, import, compile, disassemble, time, profile, trace): Fix
docstrings and error messages.
(define-stack-command): New helper, for commands that operate on a
saved stack.
(backtrace, up, down, frame, procedure, locals): New debugger
commands, in the REPL now.
(inspect, pretty-print): New "inspect" commands.
* module/ice-9/psyntax.scm (lookup): Reflow comment.
(chi-top, syntax): Add comments about mod for lookup.
(set!): Lookup the identifier in the module attached to its syntax
object. In the (set! MACRO foo) case, after expanding the macro, chi
the resulting expression with the empty wrap, as syntax-type
does. Seems to fix the case where the expansion references
lexically-bound variables.
* module/ice-9/psyntax-pp.scm: Regenerated.
* test-suite/tests/syncase.test: Add a bunch of tests.
* module/ice-9/boot-9.scm (*repl-stack*): Instead of repl-level, have a
stack.
(batch-mode?): Change to poke the stack.
* module/ice-9/deprecated.scm (set-batch-mode?!): Update deprecation
method.
* module/system/repl/common.scm (repl-prompt): Update to poke
*repl-stack* to get the level.
* module/system/repl/repl.scm (start-repl): Bind *repl-stack*
appropriately.