Ian Price [Mon, 26 Nov 2012 21:04:03 +0000 (21:04 +0000)]
Update thanks
* THANKS: Add Sjoerd Van Leent
Ian Price [Mon, 26 Nov 2012 01:24:51 +0000 (01:24 +0000)]
Fix docs for `hashtable-copy'
* doc/ref/r6rs.texi (rnrs hashtables): a true mutable argument means a
mutable copy.
Ian Price [Sun, 25 Nov 2012 12:28:41 +0000 (12:28 +0000)]
R6RS srfi library names should ignore first identifier after the :n
* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface):
(srfi :n name ids ...) -> (srfi srfi-n ids ...)
* test-suite/tests/rnrs-libraries.test ("srfi"): Add test.
Daniel Hartwig [Sat, 24 Nov 2012 14:53:34 +0000 (15:53 +0100)]
(web uri): document that uri-port is an integer
* doc/ref/web.texi (URIs):
* module/web/uri.scm (build-uri): Document that uri-port is an integer.
Daniel Hartwig [Sat, 24 Nov 2012 06:10:12 +0000 (14:10 +0800)]
syncronize web module docstrings with manual
* doc/ref/web.texi: Fix spacing. Update with a few missing function
descriptions.
* module/web/client.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/server.scm:
* module/web/uri.scm: Update docstrings from manual (reworked by Ludovic
Courtès).
Ludovic Courtès [Fri, 23 Nov 2012 23:22:20 +0000 (00:22 +0100)]
Augment `.dir-locals.el'.
* .dir-locals.el: Add more `scheme-indent-function' rules.
Ludovic Courtès [Fri, 23 Nov 2012 23:16:14 +0000 (00:16 +0100)]
Turn on the `case' warnings in auto-compilation.
* module/ice-9/boot-9.scm (%auto-compilation-options): Add
`duplicate-case-datum' and `bad-case-datum'.
Ludovic Courtès [Fri, 23 Nov 2012 22:56:01 +0000 (23:56 +0100)]
Add tests for `-Wduplicate-case-datum' and `-Wbad-case-datum'.
* test-suite/tests/tree-il.test (%opts-w-duplicate-case-datum,
%opts-w-bad-case-datum): New variables.
("warnings")["duplicate-case-datum", "bad-case-datum"]: New tests.
Ludovic Courtès [Fri, 23 Nov 2012 22:41:32 +0000 (23:41 +0100)]
doc: Mention the `duplicate-case-datum' and `bad-case-datum' warnings.
* doc/ref/api-evaluation.texi (Compilation): List the
`duplicate-case-datum' and `bad-case-datum' warnings.
Ludovic Courtès [Fri, 23 Nov 2012 22:37:29 +0000 (23:37 +0100)]
Remove reference to `scm_init_popen' when `fork' is unavailable.
Fixes <http://bugs.gnu.org/12477>.
Reported by lin ray <lin.wei.ray@gmail.com>.
* configure.ac: Define the `HAVE_FORK' Automake conditional.
* module/Makefile.am (ICE_9_SOURCES): Add `ice-9/popen.scm' only when
HAVE_FORK.
* libguile/posix.c (scm_init_posix): Register `scm_init_popen' only when
HAVE_FORK.
Ian Price [Thu, 22 Nov 2012 09:45:12 +0000 (09:45 +0000)]
R6RS `string-for-each' should accept multiple string arguments
* module/rnrs/base.scm (string-for-each): Rewrite.
* test-suite/tests/r6rs-base.test ("string-for-each"): Add tests.
Ludovic Courtès [Wed, 21 Nov 2012 22:51:16 +0000 (23:51 +0100)]
cse: Fix out-of-bounds access to the database.
Fixes <http://bugs.gnu.org/12883>.
* module/language/tree-il/cse.scm (cse)[find-dominating-lexical]: Fix
computation of the last argument passed to `unroll'.
Patch by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.
* test-suite/tests/cse.test ("cse")["http://bugs.gnu.org/12883"]: New
test.
Ludovic Courtès [Fri, 16 Nov 2012 23:11:23 +0000 (00:11 +0100)]
Update `par-map' to use nested futures.
This allows it to actually use all CPU cores, instead of having the main
thread stuck on a `wait-condition-variable'.
* module/ice-9/threads.scm (par-mapper): Add a `cons' argument; update
callers accordingly. Rewrite using nested futures.
Ludovic Courtès [Fri, 16 Nov 2012 23:20:21 +0000 (00:20 +0100)]
futures: Allow nested futures; put the main thread to work.
* module/ice-9/futures.scm (%futures-waiting, %within-future?,
%future-prompt): New variables.
(let/ec): New macro.
(process-future!): Run FUTURE's thunk in a prompt; capture FUTURE's
continuation when it aborts, and add it to %FUTURES-WAITING. Set
%WITHIN-FUTURE? in the dynamic extent of the call FUTURE's thunk.
(process-futures): Move loop body to...
(process-one-future): ... here. New procedure.
(notify-completion): New procedure.
(touch)[work, loop]: New procedures.
When %WITHIN-FUTURE? and FUTURE is started, abort; if not
%WITHIN-FUTURE, call `work' while waiting.
When FUTURE is queued, call `work' too.
* test-suite/tests/future.test ("nested futures"): New tests.
Ludovic Courtès [Fri, 16 Nov 2012 22:51:59 +0000 (23:51 +0100)]
futures: Add a record printer.
* module/ice-9/futures.scm: Add a record printer for <future>.
Ludovic Courtès [Wed, 7 Nov 2012 14:16:03 +0000 (15:16 +0100)]
futures: Keep futures unlocked while they are processing.
* module/ice-9/futures.scm (<future>)[completion]: New field.
[done?]: Rename to...
[state]: ... this. Change `set-future-done?!' to
`set-future-state!', and `future-done?' to `future-state'.
(make-future): Initialize the `completion' field to 'queued.
(with-mutex): New macro.
(process-future!): Remove `set-future-done?!' call.
(process-futures): Check `future-state'. Unlock FUTURE's mutex before
processing it. Broadcast FUTURE's `completion' cond. var. when done.
(touch): Likewise.
Ludovic Courtès [Sat, 17 Nov 2012 15:20:52 +0000 (16:20 +0100)]
Update Gnulib to
v0.0-7695-g26c0590.
* gnulib-local/m4/canonicalize.m4.diff: Remove.
* Makefile.am (EXTRA_DIST): Adjust accordingly.
Ludovic Courtès [Sat, 17 Nov 2012 15:07:00 +0000 (16:07 +0100)]
doc: Strengthen the case for pattern matching.
* doc/ref/api-compound.texi (Pairs): Warn against `cadr' & co., and add
a link to "Pattern Matching".
* doc/ref/match.texi (Pattern Matching): Add example with nested lists.
Add paragraph comparing `match' expressions and hand-written code.
Ludovic Courtès [Sat, 17 Nov 2012 14:34:49 +0000 (15:34 +0100)]
doc: Fix typo in `set-record-type-printer!' doc.
* module/srfi/srfi-9/gnu.scm (set-record-type-printer!): Change the
parameter name to `proc'.
* doc/ref/api-compound.texi (SRFI-9 Records): Update accordingly.
Andreas Rottmann [Mon, 12 Nov 2012 19:47:57 +0000 (20:47 +0100)]
Add missing R6RS `open-file-input/output-port' procedure
* module/rnrs/io/port.scm (r6rs-open): New internal helper procedure for
opening files.
(open-file-input-port, open-file-output-port): Make use of
`r6rs-open'.
(open-file-input/output-port): Implement in terms of `r6rs-open',
add to exported identifiers list.
* module/rnrs.scm (open-file-input/output-port): Add to exported
identifiers.
* test-suite/tests/r6rs-ports.test (test-input-file-opener): New
procedure, collects several tests for opening file input ports.
("7.2.7 Input Ports"): Use `test-input-file-opener' for checking
`open-file-input-port'.
(test-output-file-opener): New procedure, collects several tests for
opening file output ports.
("8.2.10 Output ports"): Use `test-output-file-opener' for checking
`open-file-output-port'.
("8.2.13 Input/output ports"): New test prefix, making use of both
`test-input-file-opener' and `test-output-file-opener' to check
`open-file-input/output-port'.
Ludovic Courtès [Sun, 11 Nov 2012 14:31:51 +0000 (15:31 +0100)]
doc: Update argument order of SRFI-9 `set-field'.
* doc/ref/api-compound.texi (SRFI-9 Records): Change argument order for
`set-field'.
Mark H Weaver [Sun, 11 Nov 2012 00:14:08 +0000 (19:14 -0500)]
srfi-9.test: avoid symbols of the form ':bar' for more robust checking.
* test-suite/tests/srfi-9.test ("incompatible field paths"): Rename
':bar' to 'bar' to avoid the possibility of the symbol name being
printed with #{...}# notation.
Ludovic Courtès [Sat, 10 Nov 2012 16:27:14 +0000 (17:27 +0100)]
doc: Document SRFI-9 functional setters.
* doc/ref/api-compound.texi (Functional ``Setters''): New section.
Ludovic Courtès [Sat, 10 Nov 2012 15:02:35 +0000 (16:02 +0100)]
doc: Move SRFI-9 records under "Compound Data Types".
Suggested by Mark Weaver.
* doc/ref/srfi-modules.texi (SRFI-9): Keep the node, but move contents
to...
* doc/ref/api-compound.texi (SRFI-9 Records): ...here.
(Record Overview): New section.
Mark H Weaver [Sat, 10 Nov 2012 21:05:24 +0000 (16:05 -0500)]
Change the argument order of 'set-fields' to match that of 'set-fields'.
* module/srfi/srfi-9/gnu.scm (set-fields): Swap order of first two
arguments.
* test-suite/tests/srfi-9.test: Update tests.
Mark H Weaver [Sat, 10 Nov 2012 19:35:49 +0000 (14:35 -0500)]
Add system/base/ck.scm to SYSTEM_BASE_SOURCES in module/Makefile.am.
* module/Makefile.am (SYSTEM_BASE_SOURCES): Add system/base/ck.scm.
Mark H Weaver [Wed, 7 Nov 2012 13:39:42 +0000 (08:39 -0500)]
Futures: Avoid creating the worker pool more than once.
* module/ice-9/futures.scm (%create-workers!): Use 'with-mutex' in case
an exception is thrown. Within the critical section, check to make
sure the worker pool hasn't already been created by another thread.
Mark H Weaver [Fri, 9 Nov 2012 10:04:13 +0000 (05:04 -0500)]
Improve error for set-fields paths leading to different types.
* module/system/base/ck.scm: New module.
* module/srfi/srfi-9.scm: Import (system base ck).
(getter-type, getter-index, getter-copier): Convert incoming argument
convention to CK form.
(define-tagged-inlinable): Convert return value convention for key
lookup to CK form.
* module/srfi/srfi-9/gnu.scm: Import (system base ck).
Rename '%set-fields-unknown-getter' to 'unknown-getter'.
(c-list, c-same-type-check): New macros.
(%set-fields): Using the CK abstract machine, arrange to check (at
macro expansion time) that all of the getters in head position
correspond to the same record type.
* test-suite/tests/srfi-9.test: Add test.
Mark H Weaver [Fri, 9 Nov 2012 08:22:40 +0000 (03:22 -0500)]
Improve error messages for invalid record definitions.
* module/srfi/srfi-9.scm (%define-record-type): Accept additional 'form'
parameter which contains the original form of 'define-record-type' or
'define-immutable-record-type'. Add elaborate pattern guard which
raises descriptive syntax errors for specific errors, and a fallback
pattern to catch anything else.
(define-record-type): Pass 'form' parameter to %define-record-type.
* module/srfi/srfi-9/gnu.scm (define-immutable-record-type): Pass 'form'
parameter to %define-record-type.
* test-suite/tests/srfi-9.test: Add tests.
Mark H Weaver [Sat, 10 Nov 2012 04:02:44 +0000 (23:02 -0500)]
Fix non-toplevel srfi-9 compile-time error tests to actually be non-toplevel.
* test-suite/tests/srfi-9.test: Move non-toplevel record definitions to be
within the expression passed to 'compile'.
Mark H Weaver [Sat, 10 Nov 2012 03:23:46 +0000 (22:23 -0500)]
Use 'pass-if-equal' to check syntax-error exceptions in srfi-9.test.
* test-suite/tests/srfi-9.test: Convert detailed syntax-error exception
tests to use 'pass-if-equal'.
Mark H Weaver [Fri, 9 Nov 2012 02:53:36 +0000 (21:53 -0500)]
Fix record constructor in getopt-long.
* module/ice-9/getopt-long.scm (%make-option-spec): Fix the formal
argument list to match the actual fields present.
(make-option-spec): Update to match the fixed %make-option-spec.
Mark H Weaver [Wed, 7 Nov 2012 17:21:44 +0000 (12:21 -0500)]
Implement functional record setters.
Written in collaboration with Ludovic Courtès <ludo@gnu.org>
* module/srfi/srfi-9.scm: Internally, rename 'accessor' to 'getter'
and 'modifier' to 'setter'.
(define-tagged-inlinable, getter-type, getter-index, getter-copier,
%%on-error, %%set-fields): New macros.
(%define-record-type): New macro for creating both mutable and
immutable records, and containing a substantially rewritten version of
the code formerly in 'define-record-type'.
(define-record-type): Now just a wrapper for '%define-record-type'.
(throw-bad-struct, make-copier-id): New procedures.
* module/srfi/srfi-9/gnu.scm (define-immutable-record-type, set-field,
and set-fields): New exported macros.
(collate-set-field-specs): New procedure.
(%set-fields-unknown-getter, %set-fields): New macros.
* test-suite/tests/srfi-9.test: Add tests. Rename getters and setters
in existing tests to make the functional setters look better.
Ludovic Courtès [Mon, 5 Nov 2012 20:43:13 +0000 (21:43 +0100)]
Fix invalid assertion about mutex ownership in threads.c.
* libguile/threads.c (do_thread_exit): Don't assert m->owner == t->handle
since that is not the case when MUTEX was abandoned by T. Reported by Mark
Weaver and others.
Ludovic Courtès [Mon, 5 Nov 2012 18:04:13 +0000 (19:04 +0100)]
Have `SCM_NUM2FLOAT' and `SCM_NUM2DOUBLE' use `scm_to_double'.
* libguile/validate.h (SCM_NUM2FLOAT, SCM_NUM2DOUBLE): Use
`scm_to_double' instead of the deprecated functions. Reported by
Aleix Conchillo Flaqué <aconchillo@gmail.com>.
Ludovic Courtès [Mon, 5 Nov 2012 17:59:14 +0000 (18:59 +0100)]
Fix copyright years in `futures.scm'.
* module/ice-9/futures.scm: Update copyright years.
Mark H Weaver [Sun, 4 Nov 2012 05:01:06 +0000 (01:01 -0400)]
Preserve additional R6RS library name components after srfi :n
* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface):
(srfi :n ...) -> (srfi srfi-n ...) instead of (srfi srfi-n).
Ludovic Courtès [Sat, 3 Nov 2012 00:05:19 +0000 (01:05 +0100)]
futures: Have workers work when futures are available.
Reported by David Pirotte.
* module/ice-9/futures.scm (process-futures): Wait on %FUTURES-AVAILABLE
only when %FUTURES is empty.
The problem was obvious when running (begin (use-modules (ice-9
threads)) (par-map 1+ (iota 400000))) : eventually, only the main
thread would do the work, while the others would remain idle, waiting
on %FUTURES-AVAILABLE.
Ludovic Courtès [Fri, 2 Nov 2012 23:20:23 +0000 (00:20 +0100)]
Fix `generalized-vector->list' indexing bug with shared arrays.
Fixes <http://bugs.gnu.org/12465>.
Reported by Daniel Llorens <daniel.llorens@bluewin.ch>.
* libguile/generalized-vectors.c (scm_generalized_vector_to_list): Fix
initial value of POS; pass the `h.base + pos', not just `pos' as the
`vref' argument.
* test-suite/tests/arrays.test ("array->list")["http://bugs.gnu.org/12465
- ok", "http://bugs.gnu.org/12465 - bad]: New tests.
("generalized-vector->list"): New test prefix.
Ludovic Courtès [Fri, 2 Nov 2012 22:29:43 +0000 (23:29 +0100)]
test-suite: Add a nameless form of `pass-if-equal'.
* test-suite/test-suite/lib.scm (pass-if-equal): Add a nameless pattern.
* test-suite/tests/arrays.test ("array->list"): Use `pass-if-equal'.
Ludovic Courtès [Wed, 31 Oct 2012 23:47:41 +0000 (00:47 +0100)]
scandir: Use `lstat' instead of `stat'.
* module/ice-9/ftw.scm (scandir): Use `lstat', not `stat'.
* test-suite/tests/ftw.test ("scandir")["symlink to directory"]: New
test.
Ludovic Courtès [Wed, 31 Oct 2012 23:43:58 +0000 (00:43 +0100)]
test-suite: Use `pass-if-equal' in `ftw.test'.
* test-suite/tests/ftw.test ("file-system-fold")["test-suite (never
enter)", "test-suite/lib.scm (flat file)"]: Use `pass-if-equal'
instead of `pass-if'.
Ludovic Courtès [Wed, 31 Oct 2012 23:42:37 +0000 (00:42 +0100)]
test-suite: Add `pass-if-equal'.
* test-suite/test-suite/lib.scm (pass-if-equal): New macro.
(run-test): Upon `fail', pass ARGS to REPORT.
Mark H Weaver [Wed, 31 Oct 2012 02:58:19 +0000 (22:58 -0400)]
Fix formatting of comments in scm_read_array.
* libguile/read.c (scm_read_array): Fix formatting of comments.
Mark H Weaver [Wed, 31 Oct 2012 02:53:22 +0000 (22:53 -0400)]
scm_read_shebang: handle non-ascii characters properly.
* libguile/read.c (scm_read_shebang): Abort scan for reader directive
if a character other than [-a-z0-9] is encountered.
Mark H Weaver [Tue, 30 Oct 2012 06:23:07 +0000 (02:23 -0400)]
Test number-theoretic division by -0.0.
* test-suite/tests/numbers.test ("Number-theoretic division"): Fix typo
so that we actually test for division by -0.0.
Mark H Weaver [Mon, 29 Oct 2012 23:37:56 +0000 (19:37 -0400)]
Minor tweaks to srfi-105.test
* test-suite/tests/srfi-105.test ("curly-infix"): Minor tweaks.
Mark H Weaver [Fri, 26 Oct 2012 21:20:16 +0000 (17:20 -0400)]
Implement SRFI-105 curly infix expressions.
* 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.
Mark H Weaver [Wed, 24 Oct 2012 18:37:36 +0000 (14:37 -0400)]
Implement #!fold-case and #!no-fold-case reader directives.
* libguile/read.c (set_port_case_insensitive_p): New function.
(scm_read_shebang): Handle #!fold-case and #!no-fold-case.
* doc/ref/api-evaluation.texi (Case Sensitivity, Scheme Read): Document
the #!fold-case and #!no-fold-case reader directives.
* test-suite/tests/reader.test ("per-port-read-options"): Add tests.
Mark H Weaver [Tue, 23 Oct 2012 21:28:43 +0000 (17:28 -0400)]
Implement per-port read options.
* libguile/read.c (scm_t_read_opts): Update comment to mention the
per-port read options.
(sym_port_read_options): New variable.
(set_port_read_option): New function.
(init_read_options): Add new 'port' parameter, and consult the
per-port read option overrides when initializing the 'scm_t_read_opts'
struct. Move to bottom of file.
(scm_read): Pass 'port' parameter to init_read_options.
Mark H Weaver [Tue, 23 Oct 2012 04:36:12 +0000 (00:36 -0400)]
Repurpose scm_i_port_weak_hash to associate an alist with each port.
* libguile/ports.c (scm_i_port_weak_hash): Document that the values in
this hash table will now be alists. Previously the value slots were
unused.
(scm_new_port_table_entry): Change the initial value of the entry in
scm_i_port_weak_hash from SCM_BOOL_F to SCM_EOL.
Mark H Weaver [Tue, 23 Oct 2012 04:29:07 +0000 (00:29 -0400)]
Generalize scm_read_shebang to handle other reader directives.
* libguile/read.c (READER_DIRECTIVE_NAME_MAX_SIZE): New C macro.
(scm_read_shebang): Rewrite to handle arbitrary reader directives.
Mark H Weaver [Tue, 23 Oct 2012 04:21:12 +0000 (00:21 -0400)]
Add source properties to more datum types in scm_read_sharp_extension.
* libguile/read.c (scm_read_sharp_extension): Attach source properties
to the result of a custom token reader if the returned datum is not
immediate. Previously, source properties were added to pairs only.
Mark H Weaver [Tue, 23 Oct 2012 21:11:41 +0000 (17:11 -0400)]
Change reader to pass read options to helpers via explicit parameter.
* libguile/read.c (enum t_keyword_style, struct t_read_opts,
scm_t_read_opts): New types.
(init_read_options): New function.
(CHAR_IS_DELIMITER): Look up square-brackets option via local 'opts'.
(scm_read): Call 'init_read_options', and pass 'opts' to helpers.
(flush_ws, maybe_annotate_source, read_complete_token, read_token,
scm_read_bytevector, scm_read_character,
scm_read_commented_expression, scm_read_expression,
scm_read_guile_bit_vector, scm_read_keyword,
scm_read_mixed_case_symbol, scm_read_nil, scm_read_number,
scm_read_number_and_radix, scm_read_quote, scm_read_sexp,
scm_read_sharp, scm_read_sharp_extension, scm_read_shebang,
scm_read_srfi4_vector, scm_read_string, scm_read_syntax,
scm_read_vector, scm_read_array): Add 'opts' as an additional
parameter, and use it to look up read options. Previously the global
read options were consulted directly.
Mark H Weaver [Tue, 23 Oct 2012 03:28:56 +0000 (23:28 -0400)]
Minor tweaks to delimiter handling in read.c
* libguile/read.c (CHAR_IS_R5RS_DELIMITER, CHAR_IS_DELIMITER): Move the
'[' and ']' delimiters from CHAR_IS_R5RS_DELIMITER to
CHAR_IS_DELIMITER. Parenthesize all references to the macro
parameter. Don't check the global square-brackets read option until
after we know the character is '[' or ']'.
(scm_read_sexp): Don't check the global square-brackets read option
until after we know the character is ']'.
Mark H Weaver [Tue, 23 Oct 2012 03:23:45 +0000 (23:23 -0400)]
Move array reader from arrays.c to read.c
* libguile/arrays.c (read_decimal_integer): Move to read.c.
(scm_i_read_array): Remove. Incorporate the code into the
'scm_read_array' static function in read.c.
* libguile/arrays.h (scm_i_read_array): Remove prototype.
* libguile/read.c (read_decimal_integer): Move here from read.c.
(scm_read_array): Incorporate the code from 'scm_i_read_array'. Call
'scm_read_vector' and 'scm_read_sexp' instead of 'scm_read'.
Ian Price [Wed, 19 Sep 2012 16:40:17 +0000 (17:40 +0100)]
Fix typo in scheme-using.texi
* doc/ref/scheme-using.texi (System Commands): Fix typo.
Ian Price [Wed, 19 Sep 2012 16:33:29 +0000 (17:33 +0100)]
Fix @@ usage in --listen option
* module/ice-9/command-line.scm (compile-shell-switches): Fix usage of
@@, which no longer supports arbitrary expressions, only identifiers.
Mark H Weaver [Sun, 14 Oct 2012 00:41:45 +0000 (20:41 -0400)]
Remove prototype for scm_read_token, which does not exist.
* libguile/read.h: Remove prototype for scm_read_token.
Mark H Weaver [Sun, 14 Oct 2012 00:28:27 +0000 (20:28 -0400)]
Improve formatting of options help given long option names
* module/ice-9/boot-9.scm (define-option-interface): When printing
options help, e.g. for (read-options 'help), expand the width of the
first column by another tab stop, to accommodate option names of up to
23 characters.
Ludovic Courtès [Sat, 13 Oct 2012 19:13:10 +0000 (21:13 +0200)]
web: Fix possible file descriptor leak in `open-socket-for-uri'.
* module/web/client.scm (open-socket-for-uri): Always close S in the
`system-error' handler.
Ludovic Courtès [Fri, 12 Oct 2012 21:09:44 +0000 (23:09 +0200)]
web: Pass `AI_NUMERICSERV' when given a port number.
* module/web/client.scm (open-socket-for-uri)[addresses]: Pass
AI_NUMERICSERV as the `getaddrinfo' hint when (uri-port URI) is true.
Ludovic Courtès [Fri, 12 Oct 2012 21:05:22 +0000 (23:05 +0200)]
web: Change `http-get' to try all the addresses for the given URI.
* module/web/client.scm (open-socket-for-uri): Try all the addresses
returned by `getaddrinfo' until one succeeds.
Ludovic Courtès [Fri, 12 Oct 2012 21:03:39 +0000 (23:03 +0200)]
Implement `hash' for structs.
* libguile/hash.c (scm_hasher): Call `scm_i_struct_hash' upon
`scm_tcs_struct'.
* libguile/struct.c (scm_i_struct_hash): New function.
* libguile/struct.h (scm_i_struct_hash): New declaration.
* test-suite/tests/structs.test ("hash"): New test prefix.
Mark H Weaver [Fri, 12 Oct 2012 12:26:34 +0000 (08:26 -0400)]
Thanks Daniel Hartwig.
* THANKS (Contributors since the last release): Add Daniel Hartwig.
Daniel Hartwig [Mon, 8 Oct 2012 10:35:00 +0000 (18:35 +0800)]
In string-split, add support for character sets and predicates.
* libguile/srfi-13.c (string-split): Add support for splitting on
character sets and predicates, like string-index and others.
* test-suite/tests/strings.test (string-split): Add tests covering
the new argument types.
* doc/ref/api-data.texi (string-split): Update.
Signed-off-by: Mark H Weaver <mhw@netris.org>
Mark H Weaver [Wed, 10 Oct 2012 17:13:19 +0000 (13:13 -0400)]
Revert "Preserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'"
This reverts commit
3e3d32dd9b2d71ffb0703dedc4d47387e981c9b5.
Mark H Weaver [Mon, 8 Oct 2012 18:08:43 +0000 (14:08 -0400)]
Preserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'
* module/ice-9/psyntax-pp.scm (syntax-rule, define-syntax-rule):
Preserve the keyword identifier.
* module/ice-9/psyntax-pp.scm: Regenerate.
Mark H Weaver [Mon, 8 Oct 2012 15:56:10 +0000 (11:56 -0400)]
Simplify calls to 'eqv?' when one argument is an immediate constant.
* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): New
helper procedure shared by expanders for 'eqv?' and 'equal?'.
(*primitive-expand-table*): Add expansion rule for 'eqv?'.
* test-suite/tests/tree-il.test ("primitives"): Add tests.
Mark H Weaver [Mon, 8 Oct 2012 04:37:09 +0000 (00:37 -0400)]
Don't simplify 'equal?' to 'not' or 'null?'.
* module/language/tree-il/primitives.scm (*primitive-expand-table*):
Don't simplify 'equal?' to 'not' or 'null?', but only to 'eq?'.
* test-suite/tests/tree-il.test ("primitives"): Adjust tests.
Mark H Weaver [Mon, 8 Oct 2012 03:57:13 +0000 (23:57 -0400)]
Don't simplify 'equal?' to 'eq?' when constant is an *inexact* small integer.
* module/language/tree-il/primitives.scm (*primitive-expand-table*):
Refine test for fixnums to verify that the small integer is exact.
* test-suite/tests/tree-il.test ("primitives"): Add test.
Ludovic Courtès [Fri, 5 Oct 2012 23:24:46 +0000 (01:24 +0200)]
Simplify calls to `equal?' when one argument is a constant.
* module/language/tree-il/primitives.scm (*primitive-expand-table*): Add
expansion rules for `equal?', when called with one constant and
another argument.
* test-suite/tests/tree-il.test (pass-if-primitives-resolved): New
macro.
("primitives"): New test prefix.
Mark H Weaver [Sat, 6 Oct 2012 10:04:29 +0000 (06:04 -0400)]
Improve error reporting in 'append!'
* libguile/list.c (scm_append_x): Report correct argument number when
validating arguments. Validate that the last cdr of each argument is
null or nil. Rename formal rest argument from 'lists' to 'args'.
* test-suite/tests/list.test (append!): Update tests to expect correct
handling of improper lists.
Mark H Weaver [Thu, 4 Oct 2012 11:57:27 +0000 (07:57 -0400)]
Change inappropriate uses of expect-fail X to pass-if not X in chars.test
* test-suite/tests/chars.test (basic char handling): Change
inappropriate uses of 'expect-fail' to 'pass-if' with 'not' applied to
the test.
Chris K. Jester-Young [Sun, 16 Sep 2012 06:27:19 +0000 (02:27 -0400)]
In fold-matches, set regexp/notbol unless matching string start.
* module/ice-9/regex.scm (fold-matches): Set regexp/notbol if the
starting position is nonzero.
* test-suite/tests/regexp.test (fold-matches): Check that when
matching /^foo/ against "foofoofoofoo", only one match results.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Ludovic Courtès [Tue, 11 Sep 2012 21:44:59 +0000 (23:44 +0200)]
Don't stat(2) and access(2) the .go location before using it.
* module/system/base/compile.scm (ensure-directory): Rename to...
(ensure-directory): ... this. Update callers. When ERRNO is EEXIST,
assume DIR is a writable directory instead of calling `stat' and
`access?' again. Fixes UID/EUID mismatches for setuid binaries.
Reported by rixed@happyleptic.org at
<http://lists.gnu.org/archive/html/guile-user/2012-06/msg00023.html>.
Ludovic Courtès [Tue, 11 Sep 2012 21:39:32 +0000 (23:39 +0200)]
Rewrite SRFI-31 in terms of `syntax-rules'.
* module/srfi/srfi-31.scm: Use `#:export' instead of `#:export-syntax'.
(rec): Rewrite using `syntax-rules'.
* test-suite/tests/srfi-31.test ("rec special form"): Change exception
type to EXCEPTION:SYNTAX-PATTERN-UNMATCHED.
Ian Price [Thu, 6 Sep 2012 20:21:47 +0000 (21:21 +0100)]
Document (ice-9 curried definitions)
* doc/ref/Makefile.am (guile_TEXINFOS): Add curried.texi to list
* doc/ref/curried.texi: New file.
* doc/ref/guile.texi (Guile Modules): Add "Curried Definitions" to menu.
* doc/ref/scheme-ideas.texi (Lambda Alternatives): Refer to "Curried Definitions"
from the `define' section.
Ian Price [Tue, 4 Sep 2012 12:18:58 +0000 (13:18 +0100)]
`define-public' is no a longer curried definition by default.
* module/ice-9/boot-9.scm (define-public): Remove currying functionality.
* module/ice-9/curried-definitions.scm (define-public): New export.
Ludovic Courtès [Mon, 3 Sep 2012 20:40:46 +0000 (22:40 +0200)]
build: Fix race between installing `guild' and the `guile-tools' symlink.
Fixes <http://bugs.gnu.org/12015>.
Report and patch by Song.Li <Song.Li@windriver.com>.
* meta/Makefile.am (install-data-hook): Rename to...
(install-exec-hook): ... this.
Ludovic Courtès [Mon, 3 Sep 2012 20:35:33 +0000 (22:35 +0200)]
doc: Use scm_{to,from}_double instead of old API in example.
Fixed <http://bugs.gnu.org/12241>.
Reported by Kurt W. Gochko <kgochko@comcast.net>.
* doc/ref/tour.texi (Writing Guile Extensions): Change example to use
scm_{to,from}_double instead of the pre-1.8 API.
Ludovic Courtès [Mon, 3 Sep 2012 20:33:45 +0000 (22:33 +0200)]
build: Use Automake's `color-tests'.
* configure.ac: Use Automake's `color-tests'.
Ian Price [Tue, 21 Aug 2012 11:13:25 +0000 (12:13 +0100)]
ISO 8601 time format specifies zero padding for hours, not blank padding.
* doc/ref/srfi-modules.texi ("SRFI-19 Date to string"): Fix iso 8601 format strings.
* module/srfi/srfi-19.scm (directives): Fix iso 8601 format strings.
Ludovic Courtès [Sun, 26 Aug 2012 22:09:30 +0000 (00:09 +0200)]
doc: Fix description of regexp/locale encoding interaction.
* doc/ref/api-regex.texi (Regexp Functions): Update paragraph that
mentions locale encoding and strings-as-bytes.
* test-suite/tests/regexp.test ("nonascii locales")["match structures
refer to char offsets, non-ASCII pattern"]: New test.
Ludovic Courtès [Sun, 26 Aug 2012 21:42:09 +0000 (23:42 +0200)]
Update `texinfo.test' to match latest change.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo")["@url{arg}"]:
Update test as a follow-up to
dc7a9cefbf5434b6e7e503fe83faa07b24a1a6cd ("more robust texinfo alias
handling").
Ian Price [Mon, 20 Aug 2012 22:12:23 +0000 (23:12 +0100)]
Fix uri-encoding for strings with no unreserved chars
* module/web/uri.scm (uri-encode): Change test to check for unreserved
chars instead of reserved chars.
* test-suite/tests/web-uri.test ("encode"): Add test.
Ian Price [Mon, 20 Aug 2012 22:03:38 +0000 (23:03 +0100)]
Fix uri-encoding for octets 0-15
* module/web/uri.scm (uri-encode): All encoded octets should be of the
form % HEXDIGIT HEXDIGIT.
* test-suite/tests/web-uri.test ("encode"): Add test.
Andy Wingo [Sat, 25 Aug 2012 09:52:44 +0000 (11:52 +0200)]
more robust texinfo alias handling
* module/texinfo.scm (command-spec): Resolve aliases here.
(complete-start-command, make-command-parser):
(make-dom-parser, parse-environment-args): Reload command after
resolving spec, so we get the alias target.
Ludovic Courtès [Mon, 20 Aug 2012 22:36:50 +0000 (00:36 +0200)]
Micro-optimize (ice-9 format).
* module/ice-9/format.scm (format): Use `call-with-output-string'
instead of `with-output-to-string'.
Ludovic Courtès [Mon, 20 Aug 2012 21:38:21 +0000 (23:38 +0200)]
Optimize `scm_lfwrite_substr', used by `scm_simple_format'.
Fixes <http://bugs.gnu.org/12033>.
Reported by nalaginrut <nalaginrut@gmail.com>.
* libguile/print.c (scm_i_display_substring): New function.
* libguile/print.h (scm_i_display_substring): New internal declaration.
* libguile/ports.c (scm_lfwrite_substr): Use it instead of `scm_display'
+ `scm_c_substring'.
Andy Wingo [Fri, 17 Aug 2012 14:41:27 +0000 (16:41 +0200)]
reinstate type check to scm_to_utf8_stringn
* libguile/strings.c (scm_to_utf8_stringn): Re-add missing type check,
inadvertantly removed in
e3d4597469a543d97c4997b128509c2ceb13ca2b.
Mark H Weaver [Tue, 7 Aug 2012 22:14:32 +0000 (18:14 -0400)]
Revert "Add tests for 'exp' and 'expt' that should produce complex NaNs"
This reverts commit
cc26b9de1d3c21cb4be49cc61c4b5872b8f607c5.
Mark H Weaver [Tue, 7 Aug 2012 22:13:48 +0000 (18:13 -0400)]
Revert "Avoid cexp, whose C standard definition is mathematically incorrect"
This reverts commit
ecbded71bb423a6055c541d6272796aefd1486f9.
Mark H Weaver [Wed, 1 Aug 2012 02:52:17 +0000 (22:52 -0400)]
Avoid cexp, whose C standard definition is mathematically incorrect
* libguile/numbers.c (scm_exp): Do not use cexp.
Mark H Weaver [Sat, 28 Jul 2012 17:07:38 +0000 (13:07 -0400)]
Add tests for 'exp' and 'expt' that should produce complex NaNs
* test-suite/tests/numbers.test (exp, expt): Add tests that should
produce complex NaNs, but apparently don't on all systems.
Andy Wingo [Sat, 28 Jul 2012 10:28:21 +0000 (12:28 +0200)]
set struct names for <standard-vtable>, etc
* libguile/struct.c (scm_init_struct): Set the struct names for
<standard-vtable>, <applicable-struct-vtable>, and
<applicable-struct-with-setter-vtable>.
Andy Wingo [Sat, 28 Jul 2012 10:58:46 +0000 (12:58 +0200)]
update tests after vtable-vtable deprecation
* test-suite/tests/goops.test ("classes for built-in types"): Use a
vtable instead of a vtable-vtable.
* test-suite/tests/structs.test (ball-root)
("low-level struct procedures", "make-struct"): Rework to use normal
vtables instead of making new vtable-vtable.
Andy Wingo [Fri, 18 Nov 2011 10:50:50 +0000 (11:50 +0100)]
deprecate make-vtable-vtable
* libguile/struct.h:
* libguile/struct.c (scm_make_vtable_vtable): Deprecate, as you can
handle most of the use cases with make-vtable, and we don't want to
promote the creation of new roots to the type hierarchy.
(scm_i_make_vtable_vtable): The internal replacement.
Andy Wingo [Sat, 28 Jul 2012 10:43:46 +0000 (12:43 +0200)]
improve documentation for structs
* doc/ref/api-compound.texi (Structures): Update to describe
<standard-vtable>, to remove documentation for make-vtable-vtable, to
describe meta-vtables, and to add a long example.
Andy Wingo [Tue, 24 Jul 2012 21:18:33 +0000 (23:18 +0200)]
update structure documentation
* doc/ref/api-compound.texi (Records): Add a link to SRFI-9 records.
(Structures): Add a link to Records. Describe tail arrays as
deprecated, and add a rationale and some details.