* module/ice-9/boot-9.scm (%auto-compilation-options): Add
use-before-definition and non-idempotent-definition.
* module/language/tree-il/analyze.scm (<use-before-def-info>): New
analysis info.
(make-use-before-definition-analysis): New function.
(goops-toplevel-definition): Move down.
(unbound-variable-analysis, macro-use-before-definition): Remove, as
they are subsumed by use-before-def. There are some deprecated
bindings though.
(make-analyzer): Rework to allow for use-before-def analysis to handle
multiple
* module/system/base/message.scm (%warning-types): Add handlers for the
new warning types.
* test-suite/tests/tree-il.test: Add tests.
* doc/ref/api-evaluation.texi (Compilation): Update.
* doc/ref/api-evaluation.texi (Compilation): Document the -O options.
* doc/ref/api-modules.texi (Using Guile Modules): @@ docs refer to
declarative modules.
(Creating Guile Modules): Use when for 1-armed if.
(Declarative Modules): Make implications of declarative bindings more
explicit, and explicitly document ways to disable the optimization.
* module/language/tree-il/optimize.scm (tree-il-optimizations): Punt
letrectification to -O2.
* module/language/tree-il/analyze.scm (shadowed-toplevel-analysis): New
variable.
* module/language/tree-il/compile-cps.scm (%warning-passes): Add it.
* module/system/base/message.scm (%warning-types): Add it.
* test-suite/tests/tree-il.test ("warnings")["shadowed-toplevel"]: New
test prefix.
* module/ice-9/boot-9.scm (%auto-compilation-options): Add it.
* doc/ref/api-evaluation.texi (Compilation): Add 'shadowed-toplevel' and
'macro-use-before-definition'.
Suggested by Vincent Legoll <vincent.legoll@gmail.com>.
* doc/ref/api-evaluation.texi (Expression Syntax): Add an unquote and an
unquote-splicing example.
Modified-by: Mark H Weaver <mhw@netris.org>
* module/system/repl/coop-server.scm: New module.
* module/system/repl/repl.scm (start-repl): Extract body to start-repl*.
(start-repl*): New procedure.
(run-repl): Extract body to run-repl*.
(run-repl*): New procedure.
* module/system/repl/server.scm (run-server): Extract body to
run-server*.
(run-server*): New procedure.
* doc/ref/api-evaluation.texi (Cooperative REPL Servers): New node.
* module/Makefile.am (SYSTEM_SOURCES): Add system/repl/coop-server.scm.
* module/system/repl/server.scm: Import (ice-9 match) and (srfi srfi-1).
(*open-sockets*): Add comment. This is now a list of pairs with a
'force-close' procedure in the cdr.
(close-socket!): Add comment noting that it is unsafe to call this
from another thread.
(add-open-socket!): Add 'force-close' argument, and put it in the cdr
of the '*open-sockets*' entry.
(stop-server-and-clients!): Use 'match'. Remove the first element
from *open-sockets* immediately. Call the 'force-close' procedure
instead of 'close-socket!'.
(errs-to-retry): New variable.
(run-server): Add a pipe, used in the 'force-close' procedure to
cleanly shut down the server. Put the server socket into non-blocking
mode. Use 'select' to monitor both the server socket and the pipe.
Don't call 'add-open-socket!' on the client-socket. Close the pipe
and the server socket cleanly when we're asked to shut down.
(serve-client): Call 'add-open-socket!' with a 'force-close' procedure
that cancels the thread. Set the thread cleanup handler to call
'close-socket!', instead of calling it in the main body.
* doc/ref/api-evaluation.texi (REPL Servers): Add a caveat to the manual
entry for 'stop-servers-and-clients!'.
* libguile/print.c (scm_print_opts): Add 'r7rs-symbols' print option.
(symbol_has_extended_read_syntax): If the 'r7rs-symbols' option is
enabled, then disallow '|' and '\' from bare symbols.
(print_extended_symbol): Use 'scm_lfwrite' and 'scm_putc' instead of
'display_string' and 'display_character' when printing ASCII literals.
(print_r7rs_extended_symbol): New static function.
(scm_i_print_symbol_name): If the 'r7rs-symbols' option is enabled,
use 'print_r7rs_extended_symbol' instead of 'print_extended_symbol'.
* libguile/private-options.h (SCM_PRINT_R7RS_SYMBOLS_P): New macro.
(SCM_N_PRINT_OPTIONS): Increment.
* doc/ref/api-evaluation.texi (Scheme Write): Mention 'r7rs-symbols'
print option.
* test-suite/tests/print.test ("write"): Add tests.
* libguile/private-options.h (SCM_R7RS_SYMBOLS_P): New macro.
(SCM_N_READ_OPTIONS): Increment.
* libguile/read.c (scm_read_opts): Add entry for 'r7rs-symbols'.
(t_read_opts): Add field for 'r7rs_symbols_p'.
(scm_read_string_like_syntax): New function based on earlier
'scm_read_string' that handles either string literals or R7RS quoted
symbols (delimited by vertical bars), depending on the value of 'chr'.
(scm_read_string): Reimplement based on 'scm_read_string_like_syntax'.
(scm_read_r7rs_symbol): New static function.
* doc/ref/api-data.texi (Symbol Read Syntax): Briefly describe the R7RS
symbol syntax, mention the 'r7rs-symbols' read option, and give some
examples.
* doc/ref/api-evaluation.texi (Scheme Read): Mention the 'r7rs-symbols'
read option.
* test-suite/tests/reader.test ("reading"): Add test.
* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
Mention UTF-8 as another common encoding used for Scheme source files,
and that it is used by default. Change the description to leave open
the possibility of adding additional heuristics in the future.
Mention that if the coding declaration is in a #!-style block comment,
it must be the first such comment in the file. Mention the
'#:guess-encoding' keyword argument.
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-modules.texi:
* doc/ref/compiler.texi:
* doc/ref/web.texi: Make Texinfo function headers more consistent.
Change lesser used keyword notation to the predominant form.
* doc/ref/api-procedures.texi: Fix an argument name in a header that should
use repeated argument notation.
* doc/ref/srfi-modules.texi: Update references in Texinfo function
definition body to match previously updated variable notation in
definition header.
* 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/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.
* libguile/load.c (scm_ellipsis): New Variable.
(scm_parse_path_with_ellipsis): New procedure.
(scm_init_load): Initialize 'scm_ellipsis'.
(scm_init_load_path): Use 'scm_parse_path_with_ellipsis' to
handle GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH.
* libguile/load.h (scm_parse_path_with_ellipsis): Add prototype.
* doc/ref/guile-invoke.texi (Environment Variables):
doc/ref/api-evaluation.texi (Load Paths): Add documentation.
Correct description of default load path to reflect reality.
Remove 'GUILE_LOAD_PATH' from the concept index; it is already
in the variable index. Add cross references between these two
sections of the manual.
* libguile/private-options.h: Add SCM_CURLY_INFIX_P macro, and increment
SCM_N_READ_OPTIONS.
* libguile/read.c (sym_nfx, sym_bracket_list, sym_bracket_apply): New
variables.
(scm_read_opts): Add curly-infix reader option. Reformat to comply
with GNU coding standards.
(scm_t_read_opts): Add curly_infix_p and neoteric_p fields.
(init_read_options): Initialize new fields.
(CHAR_IS_DELIMITER): Add '{', '}', '[', and ']' as delimiters if
curly_infix_p is set.
(set_port_square_brackets_p, set_port_curly_infix_p): New functions.
(read_inner_expression): New function which contains the code that was
previously in 'scm_read_expression'. Handle curly braces when
curly_infix_p is set. If curly_infix_p is set and square_brackets_p
is unset, follow the Kawa convention: [...] => ($bracket-list$ ...)
(scm_read_expression): New function body to handle neoteric
expressions where appropriate.
(scm_read_shebang): Handle the new reader directives: '#!curly-infix'
and the non-standard '#!curly-infix-and-bracket-lists'.
(scm_read_sexp): Handle curly infix lists.
* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-105 feature
identifier.
* doc/ref/srfi-modules.texi (SRFI-105): Add stub doc for SRFI-105.
* doc/ref/api-evaluation.texi (Scheme Read): Add documentation for the
'curly-infix' read option, and the '#!curly-infix' and
'#!curly-infix-and-bracket-lists' reader directives.
* doc/ref/api-options.texi (Runtime Options): Add 'curly-infix' to the
list of read options.
* test-suite/Makefile.am: Add tests/srfi-105.test.
* test-suite/tests/srfi-105.test: New file.
* doc/ref/api-compound.texi
* doc/ref/api-evaluation.texi
* doc/ref/api-foreign.texi
* doc/ref/api-io.texi
* doc/ref/posix.texi
* doc/ref/srfi-modules.texi: Add missing parentheses and commas to definitions
of C functions.
* doc/ref/api-data.texi: Change from @deffn to @deftypefn for C function
with arguments not of SCM type.
* module/ice-9/local-eval.scm: New module (ice-9 local-eval) which
exports `the-environment', `local-eval', and `local-compile'.
* libguile/debug.c (scm_local_eval): New C function that calls the
Scheme implementation of `local-eval' in (ice-9 local-eval).
* libguile/debug.h (scm_local_eval): Add prototype.
* doc/ref/api-evaluation.texi (Local Evaluation): Add documentation.
* test-suite/tests/eval.test (local evaluation): Add tests.
* test-suite/standalone/test-loose-ends.c (test_scm_local_eval):
Add test.
* module/Makefile.am: Add ice-9/local-eval.scm.
Based on a patch by Mark H Weaver <mhw@netris.org>.
* 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.