Mark H Weaver [Wed, 27 Mar 2013 01:22:11 +0000 (21:22 -0400)]
SRFI-45: add promise? predicate.
* module/srfi/srfi-45.scm (promise?): Export.
* doc/ref/srfi-modules.texi (SRFI-45): Update docs.
* test-suite/tests/srfi-45.test: Add test. Add FSF copyright for 2010
and 2013. Add missing year to André van Tonder's copyright notice.
Mark H Weaver [Wed, 27 Mar 2013 01:16:26 +0000 (21:16 -0400)]
Revert "SRFI-45: Support multiple values; add promise? predicate."
This reverts commit
1d64b4edb9da4011ad06c0fab1c6225ec20b0876.
Ludovic Courtès [Mon, 25 Mar 2013 22:25:57 +0000 (23:25 +0100)]
SRFI-37: Fix infinite loop when processing short option with no required arg.
Fixes <http://bugs.gnu.org/13176>.
* module/srfi/srfi-37.scm (args-fold)[short-option-argument]: When ARGS
is a pair, always set it to its cdr.
* test-suite/tests/srfi-37.test ("SRFI-37")["short option with optional
argument omitted", "short option with optional argument provided"]:
New tests.
Ludovic Courtès [Mon, 25 Mar 2013 21:46:53 +0000 (22:46 +0100)]
getaddrinfo: Document the missing errno value for EAI_SYSTEM.
In response to <http://bugs.gnu.org/13958>.
Reported by Lluís Batlle i Rossell <viric@viric.name>.
* doc/ref/posix.texi (Network Databases): Document the missing errno
value for EAI_SYSTEM.
* libguile/net_db.c (scm_getaddrinfo): Likewise.
Ludovic Courtès [Mon, 25 Mar 2013 21:27:37 +0000 (22:27 +0100)]
build: Use portable sed constructs.
Partly fixes <http://bugs.gnu.org/14042>.
Reported by Marc Girod <marc.girod@gmail.com>.
* meta/Makefile.am (guile-config): Use separate "s" expressions to
accommodate Solaris sed.
Ludovic Courtès [Mon, 25 Mar 2013 12:51:57 +0000 (13:51 +0100)]
sendfile: Make sure we have a Linux-style `sendfile'.
* libguile/filesys.c (scm_sendfile): Change conditional to
HAVE_SYS_SENDFILE_H && HAVE_SENDFILE.
Ludovic Courtès [Mon, 25 Mar 2013 12:28:42 +0000 (13:28 +0100)]
sendfile: Check return value of `lseek'.
* libguile/filesys.c (scm_sendfile): Check return value of
`lseek_or_lseek64', and use `SCM_SYSERROR' upon error.
Ludovic Courtès [Mon, 25 Mar 2013 12:26:52 +0000 (13:26 +0100)]
Skip relevant `sendfile' tests when thread support is lacking.
* test-suite/tests/filesys.test ("sendfile")["pipe", "pipe with
offset"]: Throw to `unresolved' when not (provided? 'threads).
Ludovic Courtès [Fri, 22 Mar 2013 21:24:27 +0000 (22:24 +0100)]
tests: Add more `maybe-gc-flakiness'.
Fixes <http://bugs.gnu.org/14001>.
Reported by Dennis Clarke <dclarke@blastwave.org>.
* test-suite/tests/gc.test ("gc")["Lexical vars are collectable"]: Wrap
in `maybe-gc-flakiness'.
Ludovic Courtès [Wed, 20 Mar 2013 22:04:11 +0000 (23:04 +0100)]
Add bindings for `sendfile'.
* configure.ac: Check for <sys/sendfile.h> and `sendfile'.
* libguile/filesys.c (scm_sendfile): New function.
* libguile/filesys.h (scm_sendfile): New declaration.
* test-suite/tests/filesys.test ("sendfile"): New test prefix.
* doc/ref/posix.texi (File System): Document `sendfile'.
Ludovic Courtès [Fri, 22 Mar 2013 21:09:05 +0000 (22:09 +0100)]
texinfo plain-text: Use `match' for `stexi->plain-text'.
* module/texinfo/plain-text.scm (def)[list/spaces]: Remove.
(stexi->plain-text): Use `match' instead of `cond'.
Ludovic Courtès [Fri, 22 Mar 2013 21:05:23 +0000 (22:05 +0100)]
texinfo: Add whitespace after periods.
* module/texinfo/string-utils.scm (end-of-sentence?): New procedure.
(make-text-wrapper): Append an extra space after LINE when it matches
`end-of-sentence?' and COLLAPSE-WHITESPACE? is false.
* test-suite/tests/texinfo.serialize.test ("test-serialize"): Adjust
accordingly.
* test-suite/tests/texinfo.string-utils.test ("text wrapping")["two
spaces after end of sentence"]: New test prefix.
Ludovic Courtès [Thu, 21 Mar 2013 23:52:16 +0000 (00:52 +0100)]
build: Adjust makefiles for `guile-procedures.txt'.
* libguile/Makefile.am (all-local): New target.
* Makefile.am (libguile/guile-procedures.txt): Output to $@.tmp first.
(CLEANFILES): New variable.
Ludovic Courtès [Thu, 21 Mar 2013 18:17:13 +0000 (19:17 +0100)]
Build `guile-procedures.txt' using (texinfo) instead of `makeinfo'.
* Makefile.am (schemelibdir, schemelib_DATA): New variables.
(libguile/guile-procedures.txt): New target.
(EXTRA_DIST): Add libguile/texi-fragments-to-docstrings.
* libguile/Makefile.am (guile-procedures.txt): Remove target.
(schemelibdir, schemelib_DATA): Remove.
* libguile/texi-fragments-to-docstrings: New file.
Ludovic Courtès [Thu, 21 Mar 2013 22:22:08 +0000 (23:22 +0100)]
texinfo plain-text: Properly render @dots{}.
* module/texinfo/plain-text.scm (tag-handlers): Add `dot' handler.
Ludovic Courtès [Thu, 21 Mar 2013 18:17:56 +0000 (19:17 +0100)]
test suite: Fix typo in `texinfo.test'.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add missing
quote.
Ludovic Courtès [Thu, 21 Mar 2013 15:42:54 +0000 (16:42 +0100)]
texinfo: Recognize `@:'.
* module/texinfo.scm (read-command-token): Recognize @:.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add test.
Ludovic Courtès [Thu, 21 Mar 2013 15:37:48 +0000 (16:37 +0100)]
texinfo: Allow markup in the arguments of `@pxref'.
* module/texinfo.scm (texi-command-specs)[pxref]: Change to
`INLINE-TEXT-ARGS'.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo")["@pxref{Locales,
@code{setlocale}}"]: New test.
Ludovic Courtès [Thu, 21 Mar 2013 15:36:24 +0000 (16:36 +0100)]
test suite: Use `pass-if-equal' in texinfo.test.
* test-suite/tests/texinfo.test: Replace occurrences of
`(pass-if (equal? ...))' by `pass-if-equal'.
Mike Gran [Thu, 21 Mar 2013 16:20:31 +0000 (09:20 -0700)]
Document quit and exit
* doc/ref/posix.texi (Processes): document `quit' and `exit'
* doc/ref/r6rs.texi (rnrs programs): xref exit
Mark H Weaver [Thu, 21 Mar 2013 15:51:18 +0000 (11:51 -0400)]
Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list.
* module/ice-9/boot-9.scm (%cond-expand-features): Remove redundant list
of feature identifiers in the comment. Explain more clearly what
belongs in this list. Remove srfi-6.
* module/srfi/srfi-4.scm, module/srfi/srfi-27.scm,
module/srfi/srfi-31.scm, module/srfi/srfi-38.scm,
module/srfi/srfi-39.scm, module/srfi/srfi-42.scm,
module/srfi/srfi-45.scm, module/srfi/srfi-67.scm: Add missing
'cond-expand-provide'.
* module/srfi/srfi-69.scm: Fix erroneous 'cond-expand-provide'.
* doc/ref/srfi-modules.texi (SRFI-0): Update the list of features in
Guile core.
Mark H Weaver [Thu, 21 Mar 2013 16:41:05 +0000 (12:41 -0400)]
Mention the non-conformance of the core SRFI-6 procedures in the manual.
* doc/ref/srfi-modules.texi (About SRFI Usage): Use SRFI-13 as an
example of a module which is included in core Guile, instead of
SRFI-6.
(SRFI-6): Mention the non-conformance of the core 'open-input-string'
and 'open-output-string' procedures. Remove the claim that importing
this module does nothing. Recommend that users import the module.
Mark H Weaver [Wed, 20 Mar 2013 10:15:32 +0000 (06:15 -0400)]
Improve sqrt handling of large integers and large and small rationals.
* libguile/numbers.c (exact_integer_is_perfect_square,
exact_integer_floor_square_root): New static functions.
(scm_sqrt): Use SCM_LIKELY. Add 'scm_t_inum' variable in inum case to
reduce the number of uses of SCM_I_INUM. Rename 'mpz_t' variable.
Remove unneeded sign check. Handle bignums too large to fit in a
double. Handle fractions too large or too small to fit in a
normalized double.
* test-suite/tests/numbers.test ("sqrt"): Add tests.
Mark H Weaver [Wed, 20 Mar 2013 06:27:10 +0000 (02:27 -0400)]
Optimize inum case of exact-integer-sqrt.
* libguile/numbers.c (scm_exact_integer_sqrt): Use GMP for inum
case. It is faster than what we had before.
Mark H Weaver [Tue, 19 Mar 2013 22:48:56 +0000 (18:48 -0400)]
Sqrt returns exact results when possible.
* libguile/numbers.c (scm_sqrt): Handle exact integers and rationals in
such a way that exact results are returned whenever possible.
* test-suite/tests/numbers.test ("sqrt"): Add tests.
Mark H Weaver [Wed, 20 Mar 2013 02:38:45 +0000 (22:38 -0400)]
Optimize scm_i_divide2double for integers less than 2^DBL_MANT_DIG.
* libguile/numbers.c (scm_i_divide2double): Optimize for common case
when both operands are less than 2^DBL_MANT_DIG (normally 2^53).
Mark H Weaver [Tue, 19 Mar 2013 00:01:12 +0000 (20:01 -0400)]
SRFI-45: Support multiple values; add promise? predicate.
* module/srfi/srfi-45.scm (eager): Accept any number of arguments.
Store the list of arguments in the value record. Previously, only one
argument was accepted, and that value was stored in the value record.
(delay): Support expressions that return any number of arguments.
(force): Return the list of values stored in the value record.
(promise?): Export.
* doc/ref/srfi-modules.texi (SRFI-45): Update docs. Remove typing
for simplicity in discussing multiple values.
* test-suite/tests/srfi-45.test: Add tests. Add FSF copyright for 2010
and 2013. Add missing year to André van Tonder's copyright notice.
Mark H Weaver [Tue, 19 Mar 2013 07:25:59 +0000 (03:25 -0400)]
Use scientific notation only if there are enough trailing zeroes.
* libguile/numbers.c (idbl2str): Print large numbers in scientific
notation only if the exponent is >= 7 and the least significant
non-zero digit has value >= radix^4.
* test-suite/tests/numbers.test ("number->string"): Add tests.
Ludovic Courtès [Mon, 18 Mar 2013 21:28:23 +0000 (22:28 +0100)]
Avoid rebuild of `guile.info' at the user's site.
* configure.ac: Remove `doc/ref/effective-version.texi' from the
`AC_CONFIG_FILES'.
* doc/ref/Makefile.am ($(srcdir)/effective-version.texi): New target.
Ludovic Courtès [Mon, 18 Mar 2013 20:31:50 +0000 (21:31 +0100)]
Use byte-oriented functions in `get-bytevector*'.
* libguile/r6rs-ports.c (scm_get_bytevector_some, scm_get_bytevector_n,
scm_get_bytevector_n_x, scm_get_bytevector_all): Use
`scm_get_byte_or_eof' and `scm_peek_byte_or_eof' instead of their
`char' counterparts.
Reported by Chris K. Jester-Young.
Ludovic Courtès [Mon, 18 Mar 2013 20:28:05 +0000 (21:28 +0100)]
Define the new Linux-specific `SO_REUSEPORT'.
* libguile/socket.c (scm_init_socket)[SO_REUSEPORT]: Define
`SO_REUSEPORT'.
(scm_setsockopt, scm_getsockopt): Update docstring.
* doc/ref/posix.texi (Network Sockets and Communication): List
`SO_REUSEPORT'.
Mark H Weaver [Tue, 5 Mar 2013 10:47:56 +0000 (05:47 -0500)]
Reimplement idbl2str number printer.
Fixes <http://bugs.gnu.org/13757>.
* libguile/numbers.c (idbl2str): Reimplement.
(mem2decimal_from_point): Accept negative exponents larger than
SCM_MAXEXP that produce subnormals.
(SCM_MAX_DBL_PREC): Removed preprocessor macro.
(scm_dblprec, fx_per_radix): Removed static variables.
(init_dblprec, init_fx_radix): Removed static functions.
(scm_init_numbers): Remove initialization code for 'scm_dblprec'
and 'fx_per_radix'.
* test-suite/tests/numbers.test ("number->string"): Restore tests that
previously failed. Remove comments about problems in the number
printer that are now fixed.
Mark H Weaver [Mon, 4 Mar 2013 23:46:33 +0000 (18:46 -0500)]
Improve inexact division of exact integers.
* libguile/numbers.c (scm_i_divide2double): New function.
(scm_i_divide2double_lo2b): New variable.
(scm_i_fraction2double, log_of_fraction): Use 'scm_i_divide2double'.
(do_divide): Removed. Its code is now in 'scm_divide'.
(scm_divide2real): Removed. Superceded by 'scm_i_divide2double'.
(scm_divide): Inherit code from 'do_divide', but without support for
forcing a 'double' result (that functionality is now implemented by
'scm_i_divide2double'). Add FIXME comments in cases where divisions
might not be as precise as they should be.
(scm_init_numbers): Initialize 'scm_i_divide2double_lo2b'.
* test-suite/tests/numbers.test (dbl-epsilon-exact, dbl-max-exp): New
variables.
("exact->inexact"): Add tests.
("inexact->exact"): Add test for largest finite inexact.
Daniel Hartwig [Sat, 16 Mar 2013 11:53:07 +0000 (19:53 +0800)]
http: support IP-literal (IPv6 address) in Host header
* module/web/http.scm ("Host"): Parse and write IP-literals treating
escapes as uri module does: remove brackets on parse, replace them on
write.
* test-suite/tests/web-http.test ("request headers"): Add tests.
Daniel Hartwig [Sat, 23 Feb 2013 07:15:33 +0000 (15:15 +0800)]
add tests for read-request-line, etc.
* test-suite/web/web-http.test ("read-request-line"):
("write-request-line", "read-response-line", "write-response-line"):
Add.
Daniel Hartwig [Sat, 16 Mar 2013 09:53:53 +0000 (17:53 +0800)]
minor tweaks to web documentation
* doc/ref/web.texi: Say `World Wide Web'; the hyphenated form is almost
never used (c.f. w3.org).
General predicate arguments are named `obj'. Fill in arguments
omitted from some procedure definitions (e.g. `request-method').
Minor tweaks, such as using en-dash and missing markup as appropriate.
Wrap very long deffn lines.
* module/web/*.scm: Expand texinfo markup in doc strings. Synchronize
with changes in web.texi.
Andy Wingo [Fri, 15 Mar 2013 21:21:34 +0000 (22:21 +0100)]
more NEWS
* NEWS: Update.
Andy Wingo [Fri, 15 Mar 2013 20:13:27 +0000 (21:13 +0100)]
incremental NEWS work
* NEWS: Checkpoint.
Andy Wingo [Fri, 15 Mar 2013 18:22:18 +0000 (19:22 +0100)]
fix doc build
* doc/ref/api-data.texi (Bitwise Operations): Don't use @-commands in
@math. Fixes doc build.
* doc/ref/api-macros.texi (Syntax Rules): Fix example result.
Andy Wingo [Wed, 13 Mar 2013 22:22:34 +0000 (23:22 +0100)]
very beginnings of NEWS
* NEWS: A very very very rough start at 2.0.8 news
Andy Wingo [Wed, 13 Mar 2013 10:01:38 +0000 (11:01 +0100)]
allow for spurious wakeups from pthread_cond_wait
* libguile/threads.c (scm_call_with_new_thread, scm_spawn_thread): Allow
for spurious wakeups while waiting on cond variables. Should fix bug
10641.
Andy Wingo [Tue, 12 Mar 2013 21:07:50 +0000 (22:07 +0100)]
failing to load module in psyntax indicates an identifier is not macro
* module/ice-9/boot-9.scm (false-if-exception): Add optional #:warning
TEMPLATE ARG... tail, which indicates that we should print a warning
on failure.
(load-in-vicinity): Use the new #:warning.
(make-autoload-interface): Surround the bits that load modules with a
false-if-exception with #:warning. Fixes
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12202.
* test-suite/tests/syncase.test ("missing autoloads do not foil
psyntax"): Add a test.
Mark H Weaver [Mon, 4 Mar 2013 23:42:27 +0000 (18:42 -0500)]
Reimplement 'inexact->exact' to avoid mpq functions.
* libguile/numbers.c (scm_inexact_to_exact): Implement conversion of a
double to an exact rational without using the mpq functions.
* test-suite/tests/numbers.test (dbl-mant-dig): Simplify initializer.
(dbl-epsilon, dbl-min-exp): New variables.
("inexact->exact"): Add tests. Fix broken "2.0**i to exact and back"
test, and change it to "2.0**i to exact", to avoid use of
'exact->inexact'.
Mark H Weaver [Sun, 3 Mar 2013 10:02:53 +0000 (05:02 -0500)]
Optimize logarithms using scm_i_big2dbl_2exp
* libguile/numbers.c (log_of_exact_integer_with_size): Removed.
(log_of_exact_integer): Handle bignums too large to fit in a double
using 'scm_i_big2dbl_2exp' instead of 'scm_integer_length' and
'scm_ash'.
(log_of_fraction): Use 'log_of_exact_integer' instead of
'log_of_exact_integer_with_size'.
Mark H Weaver [Sun, 3 Mar 2013 09:58:55 +0000 (04:58 -0500)]
Simplify and improve scm_i_big2dbl, and add scm_i_big2dbl_2exp
* libguile/numbers.c (scm_i_big2dbl_2exp): New static function.
(scm_i_big2dbl): Reimplement in terms of 'scm_i_big2dbl_2exp',
with proper rounding.
* test-suite/tests/numbers.test ("exact->inexact"): Add tests.
Mark H Weaver [Sun, 3 Mar 2013 09:35:09 +0000 (04:35 -0500)]
Add 'round-ash', a rounding arithmetic shift operator
* libguile/numbers.c (left_shift_exact_integer,
floor_right_shift_exact_integer, round_right_shift_exact_integer): New
static functions.
(scm_round_ash): New procedure.
(scm_ash): Reimplement in terms of 'left_shift_exact_integer' and
'floor_right_shift_exact_integer'.
* libguile/numbers.h: Add prototype for scm_round_ash. Rename the
second argument of 'scm_ash' from 'cnt' to 'count'.
* test-suite/tests/numbers.test (round-ash, ash): Add new unified
testing framework for 'ash' and 'round-ash'. Previously, the tests
for 'ash' were not very comprehensive; for example, they did not
include a single test where the number to be shifted was a bignum.
* doc/ref/api-data.texi (Bitwise Operations): Add documentation for
'round-ash'. Improve documentation for `ash'.
Mark H Weaver [Sun, 3 Mar 2013 09:34:50 +0000 (04:34 -0500)]
Optimize and simplify fractions code.
* libguile/numbers.c (scm_exact_integer_quotient,
scm_i_make_ratio_already_reduced): New static functions.
(scm_i_make_ratio): Rewrite in terms of
'scm_i_make_ratio_already_reduced'.
(scm_integer_expt): Optimize fraction case.
(scm_abs, scm_magnitude, scm_difference, do_divide): Use
'scm_i_make_ratio_already_reduced'.
* test-suite/tests/numbers.test (expt, integer-expt): Add tests.
Mike Gran [Mon, 11 Mar 2013 02:43:38 +0000 (19:43 -0700)]
Add standalone test for smob marking
* test-suite/standalone/Makefile.am (TESTS, check_PROGRAMS): add test-smob-mark
(test_smob_mark_SOURCES, test_smob_mark_CFLAGS, test_smob_mark_LDADD): new variables
* test-suite/standalone/test-smob-mark.c: new file
Jason Earl [Sun, 10 Mar 2013 22:44:23 +0000 (23:44 +0100)]
rely on gnulib for `poll'
* configure.ac:
* libguile/fports.c (fport_input_waiting):
* libguile/poll.c (scm_primitive_poll): Rely on gnulib to provide poll
for us.
Jason Earl [Sun, 10 Mar 2013 22:40:13 +0000 (23:40 +0100)]
import `poll' from gnulib
* lib/Makefile.am:
* lib/poll.c:
* lib/poll.in.h:
* m4/gnulib-cache.m4:
* m4/gnulib-comp.m4:
* m4/poll.m4:
* m4/poll_h.m4: Add poll gnulib module.
Andy Wingo [Fri, 30 Mar 2012 18:04:16 +0000 (20:04 +0200)]
guile.m4 allows selection of guile 2.0, 1.8, etc.
* meta/guile.m4 (GUILE_PKG): New macro, chooses a version of Guile
against which to compile.
(GUILE_FLAGS, GUILE_PROGS): Rewrite to call GUILE_PKG as necessary, to
respect any previous call to GUILE_PKG, and to not require
guile-tools.
Jason Earl [Sun, 10 Mar 2013 22:20:22 +0000 (23:20 +0100)]
add %site-ccache-dir
* libguile/load.h:
* libguile/load.c (scm_sys_site_ccache_dir): New procedure.
* doc/ref/scheme-using.texi (Installing Site Packages):
* doc/ref/api-options.texi (Build Config): Add docs.
Fixes bug 10326.
Jason Earl [Sun, 10 Mar 2013 21:29:18 +0000 (22:29 +0100)]
excise use of "iff" in the manual
* doc/ref/api-compound.texi:
* doc/ref/api-control.texi:
* doc/ref/api-data.texi:
* doc/ref/api-macros.texi:
* doc/ref/api-modules.texi:
* doc/ref/api-procedures.texi:
* doc/ref/api-scheduling.texi:
* doc/ref/api-smobs.texi:
* doc/ref/api-undocumented.texi:
* doc/ref/api-utility.texi:
* doc/ref/compiler.texi:
* doc/ref/intro.texi:
* doc/ref/scheme-using.texi:
* doc/ref/sxml.texi:
* doc/ref/web.texi: Change uses of "iff" to "if, otherwise". Fixes bug
10302.
Jason Earl [Sun, 10 Mar 2013 19:20:49 +0000 (20:20 +0100)]
fix AC_CHECK_DECLS for `alarm'
* configure.ac: Fix decl check for `alarm'.
Jason Earl [Sun, 10 Mar 2013 19:12:05 +0000 (20:12 +0100)]
use chmod portably in (system base compile)
* module/system/base/compile.scm (call-with-output-file/atomic): Call
chmod with the file name instead of the port.
Jason Earl [Sun, 10 Mar 2013 18:23:31 +0000 (19:23 +0100)]
fix response-body-port for responses without content-length
* module/web/response.scm (response-body-port): Correctly handle cases
in which EOF terminates the body.
Andy Wingo [Sat, 9 Mar 2013 22:55:01 +0000 (23:55 +0100)]
provide getlogin declaration if needed.
* configure.ac: Check for getlogin decl.
* libguile/posix.c: Declare getlogin if needed.
Andy Wingo [Sat, 9 Mar 2013 22:12:51 +0000 (23:12 +0100)]
fix mingw issues with posix.c
* libguile/posix.c (scm_execl, scm_execlp, scm_execle)
(scm_open_process): Remove casts for ancient mingw.
(scm_utime): If we fall back to utime, assert that flags is 0.
(scm_getlogin): Rely on gnulib.
Andy Wingo [Sat, 9 Mar 2013 22:09:36 +0000 (23:09 +0100)]
add getlogin from gnulib
* lib/Makefile.am:
* lib/getlogin.c:
* m4/getlogin.m4:
* m4/gnulib-cache.m4: Add getlogin module.
Andy Wingo [Sat, 9 Mar 2013 21:45:33 +0000 (22:45 +0100)]
don't provide scm_std_select on mingw and similar platforms
* libguile/iselect.h: If we do not have sys/select.h, don't provide
scm_std_select, SELECT_TYPE, FD_SET, FD_ZERO, FD_ISSET, or FD_CLR.
Guile should not be setting these macros in public API. This is an
incompatible change on mingw, but oh well.
* libguile/threads.c: Rely on gnulib's select, and use that to implement
scm_std_select.
* libguile/deprecated.h:
* libguile/deprecated.c: Only provide scm_internal_select if we have
sys/select.h.
Andy Wingo [Sat, 9 Mar 2013 21:42:17 +0000 (22:42 +0100)]
simplify posix.c
* libguile/posix.c: Reorder includes to fix mingw include-order
problem. Remove ttyname shims; gnulib is the place to fix that.
Remove winsock2 include, as gnulib seems to handle that OK. Rely on
the new pipe-posix gnulib module. Don't bother shimming getlogin, etc
on mingw; gnulib is the place for shims.
Andy Wingo [Sat, 9 Mar 2013 21:40:18 +0000 (22:40 +0100)]
simplify readline.c
* guile-readline/readline.c: Remove all mingw special-casing, relying
instead on mingw / gnulib doing the right thing.
Andy Wingo [Sat, 9 Mar 2013 21:39:27 +0000 (22:39 +0100)]
simplify stime back-compat shims for tzname
* libguile/stime.c: Remove tzname declarations for ancient mingw and SGI
RS6000.
Andy Wingo [Sat, 9 Mar 2013 21:38:21 +0000 (22:38 +0100)]
mingw include order for socket.c
* libguile/socket.c: Reorder includes to fix include order on mingw.
Andy Wingo [Sat, 9 Mar 2013 21:37:29 +0000 (22:37 +0100)]
fix include-order problem in net_db.c for mingw
* libguile/net_db.c: Reorder includes to avoid include-order problem on
mingw.
Andy Wingo [Sat, 9 Mar 2013 21:34:06 +0000 (22:34 +0100)]
silence mingw32 warning in i18n.c
* libguile/i18n.c (scm_make_locale): Silence a warning.
Andy Wingo [Sat, 9 Mar 2013 21:33:24 +0000 (22:33 +0100)]
fports uses gnulib's select
* libguile/fports.c: Reorder includes to put system includes first;
fixes windows/winsock2 include error problem. Rely on Gnulib's
select module.
(fport_input_waiting): Use select instead of scm_std_select.
Andy Wingo [Sat, 9 Mar 2013 21:30:26 +0000 (22:30 +0100)]
simplify filesys.c via gnulib's select and fstat modules
* libguile/filesys.c: Instead of using scm_std_select, just use select,
relying on gnulib to provide it to us. Likewise, rely on fstat.
Andy Wingo [Sat, 9 Mar 2013 21:27:59 +0000 (22:27 +0100)]
if we have threads on windows, we have pthreads; inform bdw-gc of that
* libguile/bdw-gc.h: If we have threads enabled on mingw32, explicitly
mark GC_WIN32_PTHREADS. See
http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/5564
for more info.
Andy Wingo [Sat, 9 Mar 2013 21:26:16 +0000 (22:26 +0100)]
remove init.c iselect include
* libguile/init.c: Remove iselect include.
Andy Wingo [Sat, 9 Mar 2013 21:25:35 +0000 (22:25 +0100)]
portability simplification with scmsigs.c and alarm
* configure.ac (alarm): Check for decl.
* libguile/scmsigs.c: Reorder includes to put system includes first.
Fixes include order on mingw. Remove #define for alarm, as we will
use HAVE_DECL_ALARM. Remove #defines for sleep and usleep, as they
are not used.
(scm_alarm): Only define if HAVE_DECL_ALARM.
Andy Wingo [Sat, 9 Mar 2013 20:06:07 +0000 (21:06 +0100)]
add gnulib fstat module explicitly
* lib/Makefile.am:
* m4/gnulib-cache.m4: Explicitly add fstat module.
Andy Wingo [Sat, 9 Mar 2013 18:08:51 +0000 (19:08 +0100)]
Import `pipe-posix' module from gnulib.
* lib/Makefile.am:
* lib/pipe.c:
* m4/gnulib-cache.m4:
* m4/gnulib-comp.m4:
* m4/pipe.m4: Add pipe-posix module.
Andy Wingo [Sat, 9 Mar 2013 15:39:47 +0000 (16:39 +0100)]
squish remove some mingw-specific code that is covered by gnulib
* libguile/socket.c (scm_init_socket): Remove mingw-specific code.
* libguile/fports.c: Remove ftruncate redefine; mingw is fine.
(scm_i_fdes_to_port): If we have no F_GETFL, just do an fstat. The
right place for an F_GETFL replacement would be in gnulib.
(fport_input_waiting): Remove an outdated comment.
* libguile/error.c (SCM_I_STRERROR, SCM_I_ERRNO): Remove, replacing uses
with strerror and errno.
* libguile/win32-socket.c:
* libguile/win32-socket.h: Remove. Mingw has suitable replacements.
* configure.ac:
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
(noinst_HEADERS): Update for win32-socket removal.
Andy Wingo [Sat, 9 Mar 2013 14:56:30 +0000 (15:56 +0100)]
remove mingw32 implementations of {get,end,set}{serv,proto}ent
* libguile/win32-socket.h:
* libguile/win32-socket.c (getservent, endservent, setservent)
(getprotoent, endprotoent, setprotoent): Remove mingw32 wrappers.
Their place is in gnulib, if anywhere.
Andy Wingo [Sat, 9 Mar 2013 10:56:46 +0000 (11:56 +0100)]
add check for struct pollfd
* configure.ac: Add check for struct pollfd.
* libguile/fports.c (fport_input_waiting):
* libguile/poll.c (scm_primitive_poll): Require struct pollfd. Fixes
bug 13903.
Andy Wingo [Sat, 2 Mar 2013 18:04:47 +0000 (19:04 +0100)]
allow case-lambda expressions with no clauses
* module/ice-9/psyntax-pp.scm:
* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Allow 0
clauses.
* module/language/scheme/decompile-tree-il.scm (do-decompile):
(choose-output-names):
* module/language/tree-il.scm (unparse-tree-il):
(tree-il-fold, post-order!, pre-order!):
* module/language/tree-il/effects.scm (make-effects-analyzer):
* module/language/tree-il/cse.scm (cse):
* module/language/tree-il/debug.scm (verify-tree-il):
* module/language/tree-il/peval.scm (peval): Allow for lambda-body to be
#f.
* libguile/memoize.c (memoize):
* module/language/tree-il/canonicalize.scm (canonicalize!): Give a body
to empty case-lambda before evaluating it or compiling it,
respectively.
* test-suite/tests/optargs.test ("case-lambda", "case-lambda*"): Add
tests.
Andy Wingo [Sat, 9 Mar 2013 09:29:57 +0000 (10:29 +0100)]
fix in-tree guile reference
* meta/guile.in (GUILE): Add @EXEEXT@ for libguile/guile reference, for
MinGW compiles.
Mark H Weaver [Wed, 6 Mar 2013 17:52:39 +0000 (12:52 -0500)]
Improve standards conformance of string->number.
Fixes <http://bugs.gnu.org/11887>.
* libguile/numbers.c (mem2ureal): New argument 'allow_inf_or_nan'.
Accept infinities and NaNs only if 'allow_inf_or_nan' is true and "#e"
is not present. Check for "inf.0" or "nan." case-insensitively. Do
not accept rationals with zero divisors.
(mem2complex): Pass new 'allow_inf_or_nan' argument to 'mem2ureal',
which is set if and only if a explicit sign was present.
* test-suite/tests/numbers.test ("string->number"): Add tests.
Stefan Israelsson Tampe [Wed, 12 Dec 2012 16:37:44 +0000 (17:37 +0100)]
add GUILE_STACK_SIZE environment variable
* libguile/vm.c (initialize_default_stack_size): New helper.
(scm_bootstrap_vm): Call initialize_default_stack_size.
* doc/ref/guile-invoke.texi (Environment Variables): Add docs.
Based on a patch by Stefan Israelsson Tampe.
Andy Wingo [Thu, 7 Mar 2013 12:59:18 +0000 (13:59 +0100)]
support calls and tail-calls with more than 255 formals
* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
Support calls and tail-calls with more than 255 formals.
* test-suite/tests/tree-il.test ("many args"): Add a test.
Andy Wingo [Thu, 7 Mar 2013 10:29:01 +0000 (11:29 +0100)]
,option evaluates its right-hand-side
* doc/ref/scheme-using.texi (System Commands): Better documentation for
,option.
* module/system/repl/command.scm (option): Evaluate the RHS when setting
an option. Fixes bug 13076.
Andy Wingo [Thu, 7 Mar 2013 10:02:33 +0000 (11:02 +0100)]
GUILE_INSTALL_LOCALE=1 during build
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.scm.gen, ice-9/psyntax-pp.go):
* test-suite/Makefile.am (GUILE_AUTO_COMPILE):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* test-suite/vm/Makefile.am (TESTS_ENVIRONMENT):
* am/guilec (.scm.go): Set GUILE_INSTALL_LOCALE to 1 during the build.
Fixes bug 12887.
Ludovic Courtès [Tue, 22 Nov 2011 11:11:48 +0000 (12:11 +0100)]
Install the current locale if GUILE_INSTALL_LOCALE is nonzero.
* libguile/guile.c (get_integer_from_environment)
(should_install_locale): New functions.
(main): Add `setlocale' call.
* doc/ref/guile-invoke.texi (Environment Variables): Add documentation.
Andy Wingo [Tue, 5 Mar 2013 17:22:11 +0000 (18:22 +0100)]
structs with tail arrays are not simple
* libguile/struct.h (SCM_VTABLE_FLAG_SIMPLE, SCM_VTABLE_FLAG_SIMPLE_RW):
* libguile/struct.c (set_vtable_layout_flags): Vtable whose layouts
include a tail array are not simple. Fixes bug 12808.
Andy Wingo [Tue, 5 Mar 2013 13:42:32 +0000 (14:42 +0100)]
fix compilation under mingw
* libguile/load.c (is_absolute_file_name, search_path): Fix compilation
under mingw.
Ludovic Courtès [Wed, 6 Mar 2013 23:05:23 +0000 (00:05 +0100)]
Make `SCM_LONG_BIT' usable in preprocessor conditionals.
Reported by Jan Schukat <shookie@email.de>.
Partly fixes <http://bugs.gnu.org/13848>.
* libguile/__scm.h (SCM_LONG_BIT)[!defined LONG_BIT]: Use
SCM_SIZEOF_LONG since `sizeof' cannot be used in #if directives as
found in numbers.c.
Ludovic Courtès [Wed, 6 Mar 2013 23:03:36 +0000 (00:03 +0100)]
Use `scm_is_eq' in load.c.
* libguile/load.c (is_file_name_separator): Use `scm_is_eq' instead of `=='.
Ludovic Courtès [Mon, 4 Mar 2013 20:24:52 +0000 (21:24 +0100)]
doc: Allow compilation of r5rs.texi with Texinfo 5.0.
* doc/r5rs/r5rs.texi: Remove extraneous @author. Change @unnumbered to
@majorheading within @titlepage.
Mark H Weaver [Mon, 4 Mar 2013 23:37:23 +0000 (18:37 -0500)]
Verify that FLT_RADIX is 2.
* libguile/numbers.c: Trigger a compilation error if FLT_RADIX is not 2.
This has long been assumed by code in numbers.c.
Mark H Weaver [Sun, 3 Mar 2013 09:34:17 +0000 (04:34 -0500)]
Improve code in scm_gcd for inum/inum case
* libguile/numbers.c (scm_gcd): Improve implementation of inum/inum case
to be more clear and efficient.
Mark H Weaver [Thu, 28 Feb 2013 22:56:58 +0000 (17:56 -0500)]
Fix thread-unsafe lazy initializations.
* libguile/debug.c (scm_local_eval):
libguile/ports.c (scm_current_warning_port):
libguile/strports.c (scm_eval_string_in_module): Perform
lazy-initialization while holding a mutex. Use SCM_UNDEFINED as the
uninitialized value. Use 'scm_c_*_variable'.
* doc/ref/api-modules.texi (Accessing Modules from C): Fix
'my_eval_string' example to be thread-safe.
Ludovic Courtès [Mon, 4 Mar 2013 08:04:16 +0000 (09:04 +0100)]
doc: Rename "Texinfo" node to "Texinfo Processing".
* doc/ref/texinfo.texi (Texinfo): Rename to...
(Texinfo Processing): ... this.
* doc/ref/guile.texi (Guile Modules): Update menu.
Ludovic Courtès [Mon, 4 Mar 2013 07:56:47 +0000 (08:56 +0100)]
Use `scm_is_eq' in filesys.c.
* libguile/filesys.c (is_file_name_separator): Use `scm_is_eq' instead
of `=='. Fixes <http://hydra.nixos.org/build/
4261579>.
Bake Timmons [Sat, 2 Mar 2013 19:33:56 +0000 (20:33 +0100)]
Improve keyword notation of Texinfo function definitions.
* 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.
Ludovic Courtès [Fri, 1 Mar 2013 16:49:24 +0000 (17:49 +0100)]
doc: Fix build with Texinfo 5.0.
* doc/ref/api-control.texi (Handling Errors): Move misplaced description
for `scm_memory_error' & co.
* doc/ref/r6rs.texi (rnrs base): Change `deffnx' of `let-syntax' and
`letrec-syntax' to fit on one line.
Ludovic Courtès [Fri, 1 Mar 2013 16:45:17 +0000 (17:45 +0100)]
Allow the SMOB mark procedures to be called when libgc uses parallel markers.
Fixes <http://bugs.gnu.org/13611>.
Reported by Mike Gran <spk121@yahoo.com>.
* libguile/smob.c (current_mark_stack_pointer,
current_mark_stack_limit): New variables.
(smob_mark): Use CURRENT_MARK_STACK_POINTER and
CURRENT_MARK_STACK_LIMIT instead of the same-named fields of
`SCM_I_CURRENT_THREAD'.
(scm_gc_mark): Likewise.
(scm_smob_prehistory): Initialize CURRENT_MARK_STACK_LIMIT and
CURRENT_MARK_STACK_POINTER.
* libguile/threads.h (scm_i_thread): Add comment that
`current_mark_stack_ptr' and `current_mark_stack_limit' are no longer
used.
Ludovic Courtès [Fri, 1 Mar 2013 16:36:21 +0000 (17:36 +0100)]
Use accessors instead of symbols deprecated in libgc 7.3.
* configure.ac: Check for `GC_set_all_interior_pointers',
`GC_get_gc_no', and `GC_set_java_finalization'.
* libguile/gc.c (scm_gc_stats)[HAVE_GC_GET_GC_NO]: Use `GC_get_gc_no'.
(scm_storage_prehistory)[HAVE_GC_SET_ALL_INTERIOR_POINTERS]: Use
`GC_set_all_interior_pointers'.
* libguile/guardians.c (scm_init_guardians)[HAVE_GC_SET_JAVA_FINALIZATION]:
Use `GC_set_java_finalization'.
Daniel Hartwig [Tue, 19 Feb 2013 01:55:14 +0000 (09:55 +0800)]
test-suite: eq-ness of numbers, characters is unspecified
* test-suite/tests/00-socket.test:
* test-suite/tests/alist.test:
* test-suite/tests/elisp.test:
* test-suite/tests/encoding-iso88591.test:
* test-suite/tests/encoding-iso88597.test:
* test-suite/tests/encoding-utf8.test:
* test-suite/tests/hash.test:
* test-suite/tests/i18n.test:
* test-suite/tests/modules.test:
* test-suite/tests/ports.test:
* test-suite/tests/srfi-35.test: Make tests use eqv? instead of eq? when
comparing numbers, characters. Checked also for similar uses of
assq[-ref].
* test-suite/tests/vlist.test ("vhash-delete honors HASH"): Change test
to use eqv-ness, not eq-ness, which should not impact its purpose as
these two are equivalent for strings.
Mark H Weaver [Thu, 28 Feb 2013 23:43:09 +0000 (18:43 -0500)]
Fix later-bindings-win logic in with-fluids.
Based on a patch by David Kastrup <dak@gnu.org>.
Fixes <http://bugs.gnu.org/13843>.
* libguile/fluids.c (scm_i_make_with_fluids): Reverse direction of inner
loop that checks for duplicates, to properly handle more than two
bindings to the same fluid.