bpt/guile.git
12 years agoRemove incorrect comment in read.c
Mark H Weaver [Wed, 8 Feb 2012 08:14:17 +0000 (03:14 -0500)]
Remove incorrect comment in read.c

* libguile/read.c (scm_read_sharp): Remove incorrect comment that
  claims that scm_read_boolean might return a SRFI-4 vector.

12 years agoi18: avoid freelocale (NULL)
Andy Wingo [Wed, 8 Feb 2012 11:20:09 +0000 (12:20 +0100)]
i18: avoid freelocale (NULL)

* libguile/i18n.c (smob_locale_free): Don't freelocale (NULL).

12 years agoFix --enable-debug-malloc
Andy Wingo [Sun, 5 Feb 2012 14:55:09 +0000 (15:55 +0100)]
Fix --enable-debug-malloc

* libguile/gc-malloc.c (do_realloc, do_calloc, do_gc_malloc)
  (do_gc_malloc_atomic, do_gc_realloc, do_gc_free): Wrap the allocators
  in helper methods.  The non-GC allocators call
  scm_gc_register_allocation, and the GC allocators ensure that
  gc_malloc returns a nonzero value.
  (scm_realloc, scm_calloc): Allow NULL return for malloc(0).  It is
  permitted by POSIX.  Don't wrap in a SCM_SYSCALL; the only possible
  errno is ENOMEM.
  (scm_gc_malloc_pointerless, scm_gc_malloc, scm_gc_calloc):
  (scm_gc_realloc, scm_gc_free, scm_gc_strndump): Use the wrappers.
  Don't call the debug-malloc registrations and deregistrations, as it
  is neither mandatory nor advised to call scm_gc_free.  Fixes
  compilation with debug-malloc.
  (scm_must_free): Don't scm_malloc_unregister.

12 years agoi18n: Skips ~h `format' tests when digit grouping info is missing.
Ludovic Courtès [Sat, 4 Feb 2012 22:38:47 +0000 (23:38 +0100)]
i18n: Skips ~h `format' tests when digit grouping info is missing.

* test-suite/tests/i18n.test ("format ~h"): Skip tests when
  `locale-digit-grouping' returns '().

12 years agofix check for when libc already has clock_gettime / clock_getcpuclockid
Andy Wingo [Fri, 3 Feb 2012 15:22:50 +0000 (16:22 +0100)]
fix check for when libc already has clock_gettime / clock_getcpuclockid

* acinclude.m4 (gl_CLOCK_TIME): If both clock_gettime and
  clock_getcpuclockid are present without -lrt and -lposix4, don't add
  any libs to LIB_CLOCK_GETTIME.  Thanks to taylanbarirli@gmail.com.

12 years agoImprove consistency of definitions of C functions in manual.
Bake Timmons [Mon, 16 Jan 2012 03:18:08 +0000 (22:18 -0500)]
Improve consistency of definitions of C functions in manual.

* 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.

12 years agofix compilation of control.c, continuations.c when SCM_ALIGNED is not defined
Andy Wingo [Fri, 3 Feb 2012 12:57:32 +0000 (13:57 +0100)]
fix compilation of control.c, continuations.c when SCM_ALIGNED is not defined

* libguile/control.c:
* libguile/continuations.c: Fix for the case in which SCM_ALIGNED is not
  defined.  Though I wonder, perhaps we should just error out in those
  cases.

12 years agoMake notation for Scheme repeated arguments more consistent in manual.
Bake Timmons [Sun, 15 Jan 2012 15:56:53 +0000 (10:56 -0500)]
Make notation for Scheme repeated arguments more consistent in manual.

* doc/ref/api-compound.texi
* doc/ref/api-control.texi
* doc/ref/api-data.texi
* doc/ref/api-debug.texi
* doc/ref/api-evaluation.texi
* doc/ref/api-macros.texi
* doc/ref/api-memory.texi
* doc/ref/api-modules.texi
* doc/ref/api-procedures.texi
* doc/ref/api-regex.texi
* doc/ref/api-scheduling.texi
* doc/ref/api-utility.texi
* doc/ref/goops.texi
* doc/ref/match.texi
* doc/ref/misc-modules.texi
* doc/ref/posix.texi
* doc/ref/r6rs.texi
* doc/ref/scheme-using.texi
* doc/ref/srfi-modules.texi
* doc/ref/sxml-match.texi: Make notation for Scheme repeated arguments more
  consistent in manual.

12 years agoi18n: Provide default values for when Gnulib has no replacement.
Ludovic Courtès [Fri, 3 Feb 2012 19:11:00 +0000 (20:11 +0100)]
i18n: Provide default values for when Gnulib has no replacement.

This reverts parts of a0919aefee7512686c3374876df2c549fd47e071 ("i18n:
Use Gnulib's `nl_langinfo' module.").

* module/ice-9/i18n.scm (define-simple-langinfo-mapping): Re-add
  `default' parameter, and update users accordingly.

12 years agoAugment `-Wformat' analysis with support for `~:h'.
Ludovic Courtès [Fri, 3 Feb 2012 15:52:15 +0000 (16:52 +0100)]
Augment `-Wformat' analysis with support for `~:h'.

* module/language/tree-il/analyze.scm (format-string-argument-count):
  Add support for ~h.

* test-suite/tests/tree-il.test ("warnings")["format"]("~h", "~:h with
  locale object", "~:h without locale object"): New tests.

12 years agoformat: Add specifier ~h for localized number output.
Ludovic Courtès [Fri, 3 Feb 2012 15:35:06 +0000 (16:35 +0100)]
format: Add specifier ~h for localized number output.

* doc/ref/misc-modules.texi (Formatted Output): Document ~h.  Recommend
  use of ~h instead of ~:d.

* module/ice-9/format.scm (format): Add support for ~h.

* test-suite/tests/format.test ("~h localized number"): New test prefix.

* test-suite/tests/i18n.test (%american-english-locale-name,
  %american-english-locale): New variables.
  (under-american-english-locale-or-unresolved): New procedure.
  ("format ~h"): New test prefix.

12 years agoi18n: Add a couple of tests for `monetary-amount->locale-string'.
Ludovic Courtès [Fri, 3 Feb 2012 13:31:17 +0000 (14:31 +0100)]
i18n: Add a couple of tests for `monetary-amount->locale-string'.

* test-suite/tests/i18n.test ("monetary-amount->locale-string"): New
  test prefix.

12 years agoi18n: Use Gnulib's `nl_langinfo' module.
Ludovic Courtès [Fri, 3 Feb 2012 13:05:31 +0000 (14:05 +0100)]
i18n: Use Gnulib's `nl_langinfo' module.

* configure.ac: Remove checks for <langinfo.h> and <nl_types.h>, and
  `nl_langinfo'.

* libguile/i18n.c: Remove #ifdefs for HAVE_LANGINFO_H, HAVE_NL_TYPES_H,
  HAVE_NL_ITEM, and HAVE_LANGINFO_CODESET.
  (SCM_VALIDATE_OPTIONAL_LOCALE_COPY): Use `SCM_UNBNDP'.

* m4/gnulib-cache.m4 (gl_MODULES): Add `nl_langinfo'.

* module/ice-9/i18n.scm (define-vector-langinfo-mapping): Remove
  `defaults' parameter; assume (provided? 'nl-langinfo) is always true.
  Update users accordingly.
  (define-simple-langinfo-mapping): Likewise.
  (define-monetary-langinfo-mapping): Likewise, but do not assume
  LOCAL-ITEM and INTL-ITEM are always defined.

12 years agoUse Gnulib's `regex' module.
Ludovic Courtès [Fri, 3 Feb 2012 09:51:46 +0000 (10:51 +0100)]
Use Gnulib's `regex' module.

This should help with regex portability, as reported in
<http://bugs.gnu.org/10684> for Darwin 8.11.

* m4/gnulib-cache.m4 (gl_MODULES): Add `regex'.

* configure.ac: Remove header checks for regex.h, rxposix.h, and
  rx/rxposix.h.  Remove check for the `regcomp' function.  Remove
  definition of `HAVE_REGCOMP'.  Define `ENABLE_REGEX'.

* libguile/init.c: Check for `ENABLE_REGEX' instead of `HAVE_REGCOMP'.

* libguile/regex-posix.c: Always include <regex.h>.  Remove #ifdefs for
  rxposix.h and co.

12 years agotests: Have `getaddrinfo' test work for Darwin 8.
Ludovic Courtès [Fri, 3 Feb 2012 09:30:52 +0000 (10:30 +0100)]
tests: Have `getaddrinfo' test work for Darwin 8.

* doc/ref/posix.texi (Network Databases): Update description of
  `EAI_NODATA' to mention that Darwin provides it.

* libguile/net_db.c (scm_getaddrinfo): Likewise.

* test-suite/tests/net-db.test ("getaddrinfo")["wrong service name"]:
  Accept `EAI_NODATA' too.  Reported by David Fang <fang@csl.cornell.edu>,
  see <http://bugs.gnu.org/10684>.

12 years agotests: Work around erroneous tr_TR locale in Darwin 8.
Ludovic Courtès [Fri, 3 Feb 2012 09:17:12 +0000 (10:17 +0100)]
tests: Work around erroneous tr_TR locale in Darwin 8.

* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
  Add exception for Darwin 8.  Reported by David Fang <fang@csl.cornell.edu>,
  see <http://bugs.gnu.org/10684>.

12 years agoUpdate srfi-14 test for Unicode 6.1
Mike Gran [Fri, 3 Feb 2012 03:50:07 +0000 (19:50 -0800)]
Update srfi-14 test for Unicode 6.1

Some Latin-1 symbols have been reclassified as punctuation

* test-suite/tests/srfi-14.test: updated

12 years agoImplement scm_to_pointer
Mark H Weaver [Thu, 2 Feb 2012 22:23:35 +0000 (17:23 -0500)]
Implement scm_to_pointer

* libguile/foreign.c, libguile/foreign.h (scm_to_pointer):
  New C function.

* test-suite/standalone/test-loose-ends.c: Add test.

12 years agorevert r5rs changes
Andy Wingo [Thu, 2 Feb 2012 22:38:01 +0000 (23:38 +0100)]
revert r5rs changes

* doc/r5rs/r5rs.texi: Reverts the recent changes to r5rs.texi.

12 years agoFix `SCM_I_ERROR' definition for MinGW without networking.
Ludovic Courtès [Thu, 2 Feb 2012 20:58:04 +0000 (21:58 +0100)]
Fix `SCM_I_ERROR' definition for MinGW without networking.

* libguile/error.c (SCM_I_ERROR)[__MINGW32__]: Conditionalize on
  `HAVE_NETWORKING'.

12 years agoFix case in identifiers starting sentences in doc/r5rs/r5rs.texi
Bake Timmons [Thu, 12 Jan 2012 15:45:28 +0000 (10:45 -0500)]
Fix case in identifiers starting sentences in doc/r5rs/r5rs.texi

* doc/r5rs/r5rs.texi: Use proper case of characters in identifiers starting
  sentences.

12 years agoImprove the usage of variable names in Scheme docstrings.
Bake Timmons [Thu, 12 Jan 2012 04:55:18 +0000 (23:55 -0500)]
Improve the usage of variable names in Scheme docstrings.

* module/ice-9/boot-9.scm:
* module/ice-9/popen.scm:
* module/ice-9/pretty-print.scm:
* module/ice-9/r4rs.scm:
* module/rnrs/io/ports.scm:
* module/texinfo/string-utils.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/response.scm:
* test-suite/vm/run-vm-tests.scm: Make the variable names in Scheme docstrings more
  consistent.  Replace a few instances of @var with @code when appropriate.

12 years agoImprove the usage of variable names in C docstrings.
Bake Timmons [Thu, 12 Jan 2012 04:33:01 +0000 (23:33 -0500)]
Improve the usage of variable names in C docstrings.

* libguile/alist.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/bitvectors.c:
* libguile/filesys.c:
* libguile/foreign.c:
* libguile/generalized-arrays.c:
* libguile/hashtab.c:
* libguile/ioext.c:
* libguile/load.c:
* libguile/numbers.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procprop.c:
* libguile/promises.c:
* libguile/simpos.c:
* libguile/socket.c:
* libguile/srfi-1.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/threads.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Make the variable names in the C docstrings more
  consistent.  Replace a few instances of @var with @code when appropriate.

12 years agoRemove unused doc/sources/
Andy Wingo [Thu, 2 Feb 2012 11:16:30 +0000 (12:16 +0100)]
Remove unused doc/sources/

* doc/sources: Remove.  It is not used at all, presumably because all it
  had to offer was already incorporated in the manual.

12 years agoMake consistent the usage of variable names in the function definitions found in...
Bake Timmons [Wed, 11 Jan 2012 17:02:57 +0000 (12:02 -0500)]
Make consistent the usage of variable names in the function definitions found in the Texinfo docs.

* doc/r5rs/r5rs.texi:
* doc/ref/api-compound.texi:
* doc/ref/api-data.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-io.texi:
* doc/ref/api-modules.texi:
* doc/ref/api-procedures.texi:
* doc/ref/api-scheduling.texi:
* doc/ref/api-smobs.texi:
* doc/ref/compiler.texi:
* doc/ref/misc-modules.texi:
* doc/ref/posix.texi:
* doc/ref/scheme-using.texi:
* doc/ref/srfi-modules.texi:
* doc/ref/vm.texi:
* doc/ref/web.texi:
* doc/sources/env.texi: Make usage of variable names of function definitions
  more consistent.

12 years agoFix unbalanced parentheses in docs.
Bake Timmons [Wed, 11 Jan 2012 14:30:57 +0000 (09:30 -0500)]
Fix unbalanced parentheses in docs.

* doc/ref/sxml-match.texi (sxml-match-let, sxml-match-let*): Remove
  extraneous parenthesis at end of Texinfo function definition header.

12 years agoUpdate srfi-14 character sets to Unicode 6.1
Mike Gran [Thu, 2 Feb 2012 03:51:35 +0000 (19:51 -0800)]
Update srfi-14 character sets to Unicode 6.1

* libguile/srfi-14.i.c (cs_lower_case_ranges, cs_lower_case)
  (cs_upper_case_ranges, cs_upper_case, cs_letter_ranges, cs_letter)
  (cs_digit_ranges, cs_digit, cs_letter_plus_digit_ranges, cs_letter_plus_digit)
  (cs_graphic_ranges, cs_graphic, cs_printing_ranges, cs_printing)
  (cs_punctuation_ranges, cs_punctuation, cs_symbol_ranges, cs_symbol)
  (cs_designated_ranges, cs_designated): modified
* doc/ref/api-data.texi: modified

12 years agoFix search_path to fill stat_buf when given an absolute pathname
Mark H Weaver [Wed, 1 Feb 2012 21:35:32 +0000 (16:35 -0500)]
Fix search_path to fill stat_buf when given an absolute pathname

* libguile/load.c (search_path): When the provided 'filename' is an
  absolute pathname, perform a 'stat' on that pathname to fill the
  'stat_buf'.  Previously, 'stat_buf' was left uninitialized in this
  case, even though 'scm_primitive_load_path' assumes that 'stat_buf'
  will be filled.  Update the header comment to explicitly specify that
  'stat_buf' will be filled.  Also 'goto end' in a few failure cases
  instead of replicating its code.

12 years agoleniency in the "unused modules are removed" gc.test
Andy Wingo [Wed, 1 Feb 2012 23:10:11 +0000 (00:10 +0100)]
leniency in the "unused modules are removed" gc.test

* libguile/foreign.h: Remove comment about the finalizer bit, as I don't
  think that is the case any more.

* test-suite/tests/gc.test: Ignore flakiness in the gc-modules test.

12 years agoAugment `Libs.private' in `guile-2.0-uninstalled.pc'.
Ludovic Courtès [Tue, 31 Jan 2012 17:55:14 +0000 (18:55 +0100)]
Augment `Libs.private' in `guile-2.0-uninstalled.pc'.

Followup to 58f86505d658359508732c8f187bc37d010074d0 ("Augment
`Libs.private' with for non-GNU platforms.").

Reported by Eli Zaretskii <eliz@gnu.org>.

* meta/guile-2.0-uninstalled.pc.in (Libs): Add all the optional
  libraries, as done in commit 58f86505d658359508732c8f187bc37d010074d0.

12 years agoan experiment: clearing the C stack in gc tests
Andy Wingo [Tue, 31 Jan 2012 16:57:13 +0000 (17:57 +0100)]
an experiment: clearing the C stack in gc tests

* test-suite/lib.scm (clear-stale-stack-references): New helper.
* test-suite/tests/gc.test:
* test-suite/tests/threads.test: Use the new helper.

I removed the "unresolved" throw, as I'd like to see what the bots do
with this.

12 years agoUpdate `NEWS'.
Ludovic Courtès [Mon, 30 Jan 2012 21:36:48 +0000 (22:36 +0100)]
Update `NEWS'.

12 years agoBump version number for 2.0.4/2.0.5.
Ludovic Courtès [Mon, 30 Jan 2012 21:21:50 +0000 (22:21 +0100)]
Bump version number for 2.0.4/2.0.5.

Version 2.0.4 was pushed with the version info of 2.0.3, which is
incorrect.  Version 2.0.5 fixes that.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
  (LIBGUILE_INTERFACE_CURRENT): Increment to account for new C functions
  `scm_c_value_ref', `scm_call', etc.
  (LIBGUILE_INTERFACE_AGE): Increment.

12 years agoAmend `NEWS'.
Ludovic Courtès [Mon, 30 Jan 2012 19:58:51 +0000 (20:58 +0100)]
Amend `NEWS'.

* NEWS: Mention `-Wformat' change.  Remove intermediate/minor bug fixes.

12 years agoRemove stale test file.
Ludovic Courtès [Mon, 30 Jan 2012 19:57:42 +0000 (20:57 +0100)]
Remove stale test file.

* test-suite/tests/srfi-42.test: Delete "tmp1" at the end.

12 years agodoc: Add "warnings" to the concept index.
Ludovic Courtès [Mon, 30 Jan 2012 19:57:16 +0000 (20:57 +0100)]
doc: Add "warnings" to the concept index.

* doc/ref/api-evaluation.texi (Compilation): Add "warnings" to the
  concept index.

12 years agofix hook invocation during thread guilification
Andy Wingo [Mon, 30 Jan 2012 15:42:09 +0000 (16:42 +0100)]
fix hook invocation during thread guilification

* libguile/gc.c (run_before_gc_c_hook): Don't run pre-GC hooks from a
  thread that is in the process of guilification.

12 years agoRename scm_call_varargs -> scm_call
Mark H Weaver [Mon, 30 Jan 2012 16:02:29 +0000 (11:02 -0500)]
Rename scm_call_varargs -> scm_call

* libguile/eval.c, libguile/eval.h, doc/ref/api-evaluation.texi,
  test-suite/standalone/test-loose-ends.c, NEWS: Rename
  scm_call_varargs -> scm_call

Suggested by Ludovic Courtès <ludo@gnu.org>

12 years agoImplement scm_call_varargs and scm_call_{7,8,9}
Mark H Weaver [Mon, 30 Jan 2012 01:00:21 +0000 (20:00 -0500)]
Implement scm_call_varargs and scm_call_{7,8,9}

* libguile/eval.c (scm_call_7, scm_call_8, scm_call_9,
  scm_call_varargs): New functions.

* libguile/eval.h: Add prototypes.

* doc/ref/api-evaluation.texi: Add documentation.

* test-suite/standalone/test-loose-ends.c: Add tests.

* NEWS: Add news entry.

12 years agoFix primitive-eval to return #<unspecified> for definitions
Mark H Weaver [Sun, 29 Jan 2012 22:43:13 +0000 (17:43 -0500)]
Fix primitive-eval to return #<unspecified> for definitions

* module/ice-9/eval.scm (primitive-eval): Return #<unspecified> for
  definitions.  Previously the variable object was returned.

* test-suite/tests/eval.test (evaluator): Add test.

* NEWS: Add news entry.

12 years agoFix 'local-eval' when the specified environment is a module
Mark H Weaver [Mon, 30 Jan 2012 08:02:32 +0000 (03:02 -0500)]
Fix 'local-eval' when the specified environment is a module

* module/ice-9/local-eval.scm (local-wrap): Fix the (module? e) case, to
  reference the expression 'x' instead of the non-existent variable
  'exp', as was previously done.  Also use quasisyntax instead of
  quasiquote, so that the introduced 'lambda' is an identifier instead
  of a bare symbol, so that this will work in modules that have rebound
  'lambda' to something else.

* test-suite/tests/eval.test (local-eval): Make sure to test both
  'local-eval' and 'local-compile' when the specified environment is a
  module.

12 years agoUpdate user-visible copyright dates in manual and REPL to 2012
Mark H Weaver [Mon, 30 Jan 2012 05:33:31 +0000 (00:33 -0500)]
Update user-visible copyright dates in manual and REPL to 2012

* doc/ref/guile.texi, module/system/repl/common.scm: Update
  user-visible copyright dates to 2012.

12 years agoAugment `Libs.private' with for non-GNU platforms.
Ludovic Courtès [Sun, 29 Jan 2012 23:17:34 +0000 (00:17 +0100)]
Augment `Libs.private' with for non-GNU platforms.

Reported by Eli Zaretskii <eliz@gnu.org>.

* meta/guile-2.0.pc.in (Libs.private): Add all the optional libraries
  that may be pulled via Gnulib on non-GNU platforms.

12 years agopaper over some "lexical vars are collectable" flakiness
Andy Wingo [Sun, 29 Jan 2012 21:45:56 +0000 (22:45 +0100)]
paper over some "lexical vars are collectable" flakiness

* test-suite/tests/gc.test ("gc"): Hack around flakiness in "lexical
  vars are collectable" on some architectures.

12 years agoRevert "vm-i-scheme.c slight refactor"
Andy Wingo [Sun, 29 Jan 2012 21:31:49 +0000 (22:31 +0100)]
Revert "vm-i-scheme.c slight refactor"

This reverts commit c0e4449908eee84bcb293ec21c10fec646bde45d.

This refactor was needed for the introduction of DEAD(), which does not
appear to have been necessary.

12 years agoRevert "attempt to clear stale references on VM C stack"
Andy Wingo [Sun, 29 Jan 2012 21:24:25 +0000 (22:24 +0100)]
Revert "attempt to clear stale references on VM C stack"

This reverts commit 04b2d773548c57b6eadd1808a8d15cce47af9630.

Since it wasn't fixing the "lexical vars are collectable" test, it added
complexity with no benefit.

12 years agoRevert "Work around instruction reordering on SPARC and HPPA in the VM."
Ludovic Courtès [Sun, 29 Jan 2012 21:18:15 +0000 (22:18 +0100)]
Revert "Work around instruction reordering on SPARC and HPPA in the VM."

This reverts commit 2b264d7e4fb649955ade1814527b6eb6f34f4e18, which is
unnecessary after commit f5ea0499a411309014475dc7f7983e827f431af2
("Build with `-fno-strict-aliasing' when available.").

12 years agoFix double-free error on non-GNU systems.
Chris K. Jester-Young [Sat, 28 Jan 2012 06:34:42 +0000 (01:34 -0500)]
Fix double-free error on non-GNU systems.

* libguile/i18n.c (scm_make_locale): Null out c_locale_name after it's
  freed, so it doesn't get freed again. While this only has effect if
  USE_GNU_LOCALE_API is unset, the nulling out happens in both cases,
  to be consistent and robust.
  (scm_nl_langinfo): Free c_result in all switch cases, in particular
  P_SIGN_POSN, N_SIGN_POSN, INT_P_SIGN_POSN, and INT_N_SIGN_POSN.

12 years agomention new manual sections in NEWS
Andy Wingo [Sat, 28 Jan 2012 19:38:03 +0000 (20:38 +0100)]
mention new manual sections in NEWS

* NEWS: Mention new sections.

12 years agoBuild with `-fno-strict-aliasing' when available.
Ludovic Courtès [Fri, 27 Jan 2012 21:02:31 +0000 (22:02 +0100)]
Build with `-fno-strict-aliasing' when available.

* configure.ac (POTENTIAL_GCC_CFLAGS): Add `-fno-strict-aliasing'.
  Suggested by Mark H. Weaver.

12 years agoattempt to clear stale references on VM C stack
Andy Wingo [Fri, 27 Jan 2012 18:04:46 +0000 (19:04 +0100)]
attempt to clear stale references on VM C stack

* libguile/vm-engine.h (DEAD): New macro, nulls out a value.

* libguile/vm-i-system.c:
* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c: Use DEAD when variables become dead.

Later we can #ifdef this out, but I want to give the buildbots a try
with this patch to make sure it's correct.

12 years agovm-i-scheme.c slight refactor
Andy Wingo [Fri, 27 Jan 2012 18:09:23 +0000 (19:09 +0100)]
vm-i-scheme.c slight refactor

* libguile/vm-i-scheme.c: Refactor the RETURN macro to not include
  NEXT.  Adapt all uses to NEXT on their own.

12 years agodocument `include', `include-from-path'
Andy Wingo [Fri, 27 Jan 2012 15:26:36 +0000 (16:26 +0100)]
document `include', `include-from-path'

* doc/ref/api-evaluation.texi (Local Inclusion): New section.

12 years agomore documentation on the process of loading source and compiled files
Andy Wingo [Fri, 27 Jan 2012 12:11:58 +0000 (13:11 +0100)]
more documentation on the process of loading source and compiled files

* doc/ref/api-evaluation.texi (Load Paths): Move documentation of
  %load-path and related procedures here, from Build Config.  Add docs
  for %load-compiled-path.

* doc/ref/api-foreign.texi:
* doc/ref/api-modules.texi:
* doc/ref/api-options.texi:
* doc/ref/scheme-using.texi: Update xrefs.

12 years agoFix error messages involving definition forms
Mark H Weaver [Fri, 27 Jan 2012 04:55:24 +0000 (23:55 -0500)]
Fix error messages involving definition forms

* module/ice-9/psyntax.scm (syntax-type): Return an additional value
  that contains the entire form in _all_ cases, including for definition
  forms.  Previously, the entire form was not returned for definition
  forms.

  (expand-expr): Add an additional argument that contains the entire
  form in _all_ cases, including for definition forms.  Use it to
  include the entire form in error messages, notably for definitions in
  expression context.  Include the source location information, which
  was previously missing from these errors when the rhs expression was
  an atom.  Improve the "definition in expression context" error message
  to be more comprehensible for Scheme beginners.

  (expand-top-sequence, expand, expand-body): Adjust as needed to handle
  the additional return value from 'syntax-type' and the additional
  argument to 'expand-expr'.

* module/ice-9/psyntax-pp.scm: Regenerate.

* NEWS: Update.

12 years agoupdate NEWS
Andy Wingo [Thu, 26 Jan 2012 17:38:57 +0000 (18:38 +0100)]
update NEWS

* NEWS: Update.

12 years agofix test-loose-ends
Andy Wingo [Thu, 26 Jan 2012 17:21:01 +0000 (18:21 +0100)]
fix test-loose-ends

* test-suite/standalone/test-loose-ends.c (test_scm_local_eval): Use
  ice-9 local-eval to get (the-environment).

12 years agoupdate local-eval docs
Andy Wingo [Thu, 26 Jan 2012 15:22:35 +0000 (16:22 +0100)]
update local-eval docs

* doc/ref/api-evaluation.texi (Local Evaluation): Update docs, add some
  examples.

12 years agomore readable gensyms
Andy Wingo [Thu, 26 Jan 2012 11:02:42 +0000 (12:02 +0100)]
more readable gensyms

* module/language/tree-il/peval.scm (peval):
* module/language/tree-il/primitives.scm (dynamic-wind): When you make a
  gensym that just has to be compared against other gensyms, it will be
  unique if the prefix doesn't end in something that can be interpreted
  as a number.  There's no reason to make that character something
  difficult like " ".  So change to use a dash in that case.

* module/ice-9/psyntax-pp.scm: Regenerate.  More readable now.

12 years agoglobally unique marks and labels using syntax-session-id
Andy Wingo [Thu, 26 Jan 2012 10:52:06 +0000 (11:52 +0100)]
globally unique marks and labels using syntax-session-id

* libguile/macros.c (scm_init_macros): Add definition of new
  syntax-session-id helper.

* module/ice-9/psyntax.scm: Capture a reference to syntax-session-id at
  boot time.  Uniquify marks and labels using the session id.

* module/ice-9/boot-9.scm: Shunt syntax-session-id off to (system
  syntax) once we finished booting.

* module/ice-9/compile-psyntax.scm: Override syntax-session-id when
  remaking psyntax to avoid spurious diffs.

* module/ice-9/psyntax-pp.scm: Regenerate.

12 years agoRevert "Universally-unique gensyms"
Andy Wingo [Thu, 26 Jan 2012 10:00:55 +0000 (11:00 +0100)]
Revert "Universally-unique gensyms"

This reverts commit ad432bc8317c33899efc29854550b67f3d7babf7.

Not all gensyms need to be universally-unique: most of them just need to
be unique within some portion of a Guile session.  We'll take a
different tack on this problem in the next commit.

12 years agoImplement `local-eval', `local-compile', and `the-environment'
Andy Wingo [Tue, 3 Jan 2012 09:02:08 +0000 (04:02 -0500)]
Implement `local-eval', `local-compile', and `the-environment'

* 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>.

12 years agoFix a couple of warnings.
Ludovic Courtès [Wed, 25 Jan 2012 23:37:23 +0000 (00:37 +0100)]
Fix a couple of warnings.

* module/scripts/list.scm: Use SRFI-1.
* module/system/repl/error-handling.scm: Use (ice-9 format).

12 years agoFix typo in `-Wformat'.
Ludovic Courtès [Wed, 25 Jan 2012 23:36:39 +0000 (00:36 +0100)]
Fix typo in `-Wformat'.

* module/language/tree-il/analyze.scm (format-analysis): Call `warning',
  not `warn'.

12 years agoAdd warnings for unsupported `simple-format' options.
Ludovic Courtès [Wed, 25 Jan 2012 23:35:46 +0000 (00:35 +0100)]
Add warnings for unsupported `simple-format' options.

* module/language/tree-il/analyze.scm
  (format-analysis)[check-simple-format-args]: New procedure.  Use it.
  Add support for applications of <module-ref>.

* module/system/base/message.scm (%warning-types): Handle the `format
  simple-format' warning.

* module/language/scheme/spec.scm (scheme)[make-default-environment]:
  Use `simple-format' as the default `format'.

* test-suite/tests/tree-il.test ("warnings")["format"]: Explicitly use
  (@ (ice-9 format) format) where needed.
  ("simple-format"): New test prefix.

12 years agoImport Gnulib's `setenv' module, for MinGW.
Ludovic Courtès [Wed, 25 Jan 2012 21:35:29 +0000 (22:35 +0100)]
Import Gnulib's `setenv' module, for MinGW.

Reported by Eli Zaretskii <eliz@gnu.org>.

* m4/gnulib-cache.m4 (gl_MODULES): Add `setenv'.

12 years agonew syntax procedures to (system syntax)
Andy Wingo [Wed, 25 Jan 2012 20:29:53 +0000 (21:29 +0100)]
new syntax procedures to (system syntax)

* module/ice-9/boot-9.scm:
* module/ice-9/psyntax.scm (syntax-module, syntax-local-binding)
  (syntax-locally-bound-identifiers): After boot, move these definitions
  to a new (system syntax) module.

* module/ice-9/psyntax-pp.scm: Regenerate.

* doc/ref/api-macros.texi: Add some words about syntax-module and
  friends being in (system syntax).

12 years agoadd syntax-module
Andy Wingo [Mon, 23 Jan 2012 11:31:33 +0000 (12:31 +0100)]
add syntax-module

* module/ice-9/psyntax.scm (syntax-module): New accessor for syntax
  objects.
* module/ice-9/psyntax-pp.scm: Regenerate.

* module/ice-9/boot-9.scm: Declare syntax-module.

* doc/ref/api-macros.texi: Document it.

12 years agoadd syntax-locally-bound-identifiers
Andy Wingo [Sun, 15 Jan 2012 17:39:44 +0000 (18:39 +0100)]
add syntax-locally-bound-identifiers

* module/ice-9/boot-9.scm (syntax-locally-bound-identifiers): Declare
  variable.
* module/ice-9/psyntax.scm: Add locally-bound-identifiers helper, and
  define syntax-locally-bound-identifiers.
* module/ice-9/psyntax-pp.scm: Regenerated.
* doc/ref/api-macros.texi: Document the new procedure.

12 years agofix "lexical vars are collectable" test
Andy Wingo [Wed, 25 Jan 2012 18:03:29 +0000 (19:03 +0100)]
fix "lexical vars are collectable" test

* test-suite/tests/gc.test ("gc"): Fix "lexical vars are collectable"
  test.  (Previously, the binding was getting inlined, so we weren't
  testing what we meant to test.  Besides that, the value was a
  constant, not a closure, so it wasn't collectable in the first place!)

12 years agobetter function prologue disassembly
Andy Wingo [Wed, 25 Jan 2012 17:49:43 +0000 (18:49 +0100)]
better function prologue disassembly

* module/language/assembly/disassemble.scm (code-annotation): Add an
  annotation for assert-nargs-ee/locals and assert-nargs-ge/locals.

12 years agoadd another case in which to fold (values FOO) to FOO, for some FOO
Andy Wingo [Wed, 25 Jan 2012 09:42:54 +0000 (10:42 +0100)]
add another case in which to fold (values FOO) to FOO, for some FOO

* 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.

12 years agofix values miscompilation in push context with RA
Andy Wingo [Wed, 25 Jan 2012 09:37:25 +0000 (10:37 +0100)]
fix values miscompilation in push context with RA

* 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.

12 years agoWork around instruction reordering on SPARC and HPPA in the VM.
Ludovic Courtès [Tue, 24 Jan 2012 22:39:43 +0000 (23:39 +0100)]
Work around instruction reordering on SPARC and HPPA in the VM.

Fixes part of <http://bugs.gnu.org/10520>.
Reported by Bruno Haible <bruno@clisp.org>.

* libguile/vm-i-system.c (COMPILER_BARRIER): New macro.
  (halt, return, return_values): Insert compiler barrier after each
  assignment to `fp'.

12 years agovlist: Use (ice-9 format).
Ludovic Courtès [Tue, 24 Jan 2012 09:03:02 +0000 (10:03 +0100)]
vlist: Use (ice-9 format).

* module/ice-9/vlist.scm: Use (ice-9 format).

12 years agoFFI: Fix `set-pointer-finalizer!' to leave the type cell unchanged.
Ludovic Courtès [Mon, 23 Jan 2012 22:51:33 +0000 (23:51 +0100)]
FFI: Fix `set-pointer-finalizer!' to leave the type cell unchanged.

This is a followup to 690a0112e55823aa8b862daeddcf44cea97e7917 ("Remove
the "has finalizer?" bit from pointer objects.")

* libguile/foreign.c (scm_set_pointer_finalizer_x): Leave the type cell
  unchanged.  Before, `equal?' would break on pointers on which
  `set-pointer-finalizer!' had been called.

* test-suite/tests/foreign.test ("make-pointer")["equal? modulo
  finalizer (set-pointer-finalizer!)"]: New test.

12 years agoguile-readline: Clean `.go' files.
Ludovic Courtès [Mon, 23 Jan 2012 22:40:54 +0000 (23:40 +0100)]
guile-readline: Clean `.go' files.

* guile-readline/Makefile.am (CLEANFILES): Add *.go.

12 years agocurrent-filename canonicalizes path, remove add-to-path
Andy Wingo [Mon, 23 Jan 2012 10:13:12 +0000 (11:13 +0100)]
current-filename canonicalizes path, remove add-to-path

* 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.

12 years agoAdjust tests that relied on the output of the hash table printer.
Ludovic Courtès [Sun, 22 Jan 2012 23:44:29 +0000 (00:44 +0100)]
Adjust tests that relied on the output of the hash table printer.

* libguile/hashtab.c (scm_i_hashtable_print): Use `SCM_UNPACK', not
  `SCM2PTR'.

* test-suite/tests/hash.test: Adjust tests that rely on the output of
  the printer to just check for the suffix of the hash table's external
  representation.

12 years agoPrint the address of hash tables.
Ludovic Courtès [Sun, 22 Jan 2012 23:06:14 +0000 (00:06 +0100)]
Print the address of hash tables.

* libguile/hashtab.c (scm_i_hashtable_print): Print the address of EXP.

12 years agoAugment `release.org'.
Ludovic Courtès [Sun, 22 Jan 2012 22:22:45 +0000 (23:22 +0100)]
Augment `release.org'.

* doc/release.org: Mention debbugs and `platform-testers@gnu.org'.

12 years agoParenthesize and type `SCM_FRAME' macros; check layout of `scm_vm_frame'.
Ludovic Courtès [Sun, 22 Jan 2012 22:20:50 +0000 (23:20 +0100)]
Parenthesize and type `SCM_FRAME' macros; check layout of `scm_vm_frame'.

* libguile/frames.c: Add compile-time assertions on the layout of
  `struct scm_vm_frame'.
  (RELOC): Parenthesize and type VAL.

* libguile/frames.h (SCM_FRAME_STRUCT): Write in terms of
  `SCM_FRAME_DATA_ADDRESS'.
  (SCM_FRAME_DATA_ADDRESS): Parenthesize and type FP.
  (SCM_FRAME_SET_DYNAMIC_LINK): Write in terms of
  `SCM_FRAME_DYNAMIC_LINK'.

* libguile/vm.c (RELOC): Parenthesize and type SCM_P.

12 years agoRelax `asm-to-bytecode.test' for when target CPU == native CPU.
Ludovic Courtès [Sat, 21 Jan 2012 15:35:58 +0000 (16:35 +0100)]
Relax `asm-to-bytecode.test' for when target CPU == native CPU.

* test-suite/tests/asm-to-bytecode.test (native-cpu, native-word-size):
  New procedures.
  (test-target): When the target is the native CPU, use the native word
  size instead of WORD-SIZE.

12 years agoUniversally-unique gensyms
Mark H Weaver [Wed, 18 Jan 2012 07:53:05 +0000 (02:53 -0500)]
Universally-unique gensyms

* libguile/symbols.c (scm_gensym): Make the gensym counter a 128-bit
  thread-local, initialized to a random number upon the first call to
  `gensym' within a given thread.  This counter is rendered as a 22 byte
  suffix of mostly base64 digits.

* libguile/threads.h (scm_i_thread): Add a thread-local gensym_counter.

* libguile/threads.c (guilify_self_1): Initialize gensym_counter to NULL.

12 years agoAdd `random-state-from-platform' and `scm_i_random_bytes_from_platform'
Mark H Weaver [Wed, 18 Jan 2012 07:36:17 +0000 (02:36 -0500)]
Add `random-state-from-platform' and `scm_i_random_bytes_from_platform'

* libguile/random.c (scm_random_state_from_platform): New procedure.
  (scm_i_random_bytes_from_platform): New internal function.

* libguile/random.h (scm_random_state_from_platform,
  scm_i_random_bytes_from_platform): Add prototypes.

* doc/ref/api-data.texi (Random): Add documentation.

12 years agoadd current-filename, add-to-path, add-to-load-path
Andy Wingo [Fri, 20 Jan 2012 23:08:17 +0000 (00:08 +0100)]
add current-filename, add-to-path, add-to-load-path

* module/ice-9/boot-9.scm (current-filename, add-to-path)
  (add-to-load-path): New syntaxen.

* doc/ref/api-evaluation.texi (Loading): Move load-path related
  procedures to a new section:
  (Load Paths): Hither.  Document add-to-path and add-to-load-path.

* doc/ref/api-debug.texi (Source Properties): Document
  current-source-location and current-filename.

* doc/ref/api-modules.texi:
* doc/ref/guile-invoke.texi:
* doc/ref/scheme-using.texi: Update @ref for Load Paths change.

12 years agoremove duplicate when/unless definitions
Andy Wingo [Fri, 20 Jan 2012 20:16:50 +0000 (21:16 +0100)]
remove duplicate when/unless definitions

* module/rnrs/control.scm:
* module/sxml/ssax.scm:
* test-suite/lalr/common-test.scm: Remove local `when'/`unless'
  definitions.

12 years agoadd when, unless
Andy Wingo [Fri, 20 Jan 2012 18:47:02 +0000 (19:47 +0100)]
add when, unless

* module/ice-9/boot-9.scm (when, unless): New forms.

* doc/ref/api-control.texi (Conditionals): Add docs.  Rename this
  node from "if cond case".

* doc/ref/r6rs.texi:
* doc/ref/scheme-ideas.texi:
* doc/ref/srfi-modules.texi: Update referrers.

12 years agoavoid gensym when making labels in psyntax
Andy Wingo [Thu, 19 Jan 2012 12:08:19 +0000 (13:08 +0100)]
avoid gensym when making labels in psyntax

* module/ice-9/psyntax.scm (gen-label): Avoid gensym, as we don't need
  to make symbols.

* module/ice-9/psyntax-pp.scm: Regenerate.

12 years agoadd syntax-local-binding
Andy Wingo [Sun, 15 Jan 2012 16:51:02 +0000 (17:51 +0100)]
add syntax-local-binding

* 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.

12 years agoAdd `scm_c_value_ref' to allow access to multiple returned values from C
Mark H Weaver [Wed, 18 Jan 2012 22:52:43 +0000 (17:52 -0500)]
Add `scm_c_value_ref' to allow access to multiple returned values from C

Based on a patch by Julian Graham <julian@member.fsf.org>

* libguile/values.c, libguile/values.h (scm_c_value_ref): New function.
* doc/ref/api-control.texi (Multiple Values): Add documentation.
* test-suite/standalone/test-scm-values.c: New test program.
* test-suite/standalone/Makefile.am: Add test-scm-values test.

12 years agoUpdate Gnulib to v0.0-6827-g39c3009; use the `dirfd' module.
Ludovic Courtès [Mon, 16 Jan 2012 22:49:21 +0000 (23:49 +0100)]
Update Gnulib to v0.0-6827-g39c3009; use the `dirfd' module.

* m4/gnulib-cache.m4: Use `dirfd'.

* libguile/filesys.c: Include Gnulib's <dirent.h> directly.
  (dirfd): Remove.  Suggested by Bruno Haible <bruno@clisp.org>.

12 years agoImprove wording in README regarding `pkg-config'.
Ludovic Courtès [Mon, 16 Jan 2012 21:17:50 +0000 (22:17 +0100)]
Improve wording in README regarding `pkg-config'.

* README: Mention $PKG_CONFIG_PATH, and make it clear that $BDW_GC_LIBS,
  etc. aren't normally needed.

12 years agoFix typo in threads.c on IA64.
Ludovic Courtès [Mon, 16 Jan 2012 21:16:34 +0000 (22:16 +0100)]
Fix typo in threads.c on IA64.

* libguile/threads.c (guilify_self_1)[__ia64__]: Fix typo.  Reported by
  Bruno Haible <bruno@clisp.org>.

12 years agoSkip `tr_TR' tests on Solaris 2.10.
Ludovic Courtès [Mon, 16 Jan 2012 20:09:21 +0000 (21:09 +0100)]
Skip `tr_TR' tests on Solaris 2.10.

* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
  Special-case Solaris 2.10.

12 years agoAdd #ifdefs for langinfo items that don't exist on OpenBSD.
Chris K. Jester-Young [Sun, 15 Jan 2012 18:59:49 +0000 (13:59 -0500)]
Add #ifdefs for langinfo items that don't exist on OpenBSD.

* libguile/i18n.c (define_langinfo_items): Add #ifdefs for ERA_* and
  ALT_DIGITS, as those constants don't exist on OpenBSD.

12 years agoCall scm-error with the correct argument order.
Chris K. Jester-Young [Fri, 14 Oct 2011 04:27:27 +0000 (00:27 -0400)]
Call scm-error with the correct argument order.

* module/ice-9/boot-9.scm (catch, with-throw-handler): Switch the order
  of the error key and function name arguments.

12 years agoHave `statprof.test' fail gracefully when samples could not be collected.
Ludovic Courtès [Sat, 14 Jan 2012 22:02:03 +0000 (23:02 +0100)]
Have `statprof.test' fail gracefully when samples could not be collected.

* test-suite/tests/statprof.test ("statistical sample counts within
  expected range"): Throw unresolved when one of A-DATA, B-DATA, and
  C-DATA is #f, which means samples were not collected for this one.

12 years agoAvoid non-portable `tail' argument in `test-guile-snarf'.
Ludovic Courtès [Sat, 14 Jan 2012 21:25:59 +0000 (22:25 +0100)]
Avoid non-portable `tail' argument in `test-guile-snarf'.

* test-suite/standalone/test-guile-snarf (strip_first_line): New
  function.
  (snarf): Use it.

12 years agoFix signed/unsigned pointer mismatches.
Ludovic Courtès [Sat, 14 Jan 2012 21:22:22 +0000 (22:22 +0100)]
Fix signed/unsigned pointer mismatches.

* libguile/foreign.c (scm_pointer_to_bytevector,
  scm_bytevector_to_pointer): Use pointers of the same signedness.