bpt/guile.git
12 years agoinstall pthread_atfork handlers for guile's static mutexen
Andy Wingo [Wed, 8 Feb 2012 18:57:41 +0000 (19:57 +0100)]
install pthread_atfork handlers for guile's static mutexen

* libguile/async.c:
* libguile/deprecation.c:
* libguile/fluids.c:
* libguile/gc.c:
* libguile/instructions.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/strings.c:
* libguile/threads.c: Use the SCM_PTHREAD_ATFORK_LOCK_STATIC_MUTEX
  mechanism to lock a number of static mutexen.

12 years agoadd pthread_atfork helpers to our threading shims
Andy Wingo [Fri, 17 Feb 2012 10:35:02 +0000 (11:35 +0100)]
add pthread_atfork helpers to our threading shims

* libguile/null-threads.h:
* libguile/pthread-threads.h (SCM_DEFINE_ATFORK_HANDLERS_FOR_MUTEX)
  (scm_i_pthread_atfork): Define a pthread_atfork shim, and a helper to
  declare procedures to lock and unlock a mutex.

* libguile/threads.h (SCM_PTHREAD_ATFORK_LOCK_STATIC_MUTEX): New macro,
  causes the snarfer to emit a pthread_atfork call to lock a mutex, if
  threads are enabled.

12 years agowith a threaded guile, lock weak sets and tables during a fork
Andy Wingo [Fri, 17 Feb 2012 10:47:52 +0000 (11:47 +0100)]
with a threaded guile, lock weak sets and tables during a fork

* libguile/weak-set.c (make_weak_set):
* libguile/weak-table.c (make_weak_table): If we have a threaded Guile,
* keep a weak set (table) of weak sets (tables).  Use this and the
  pthread_atfork mechanism to lock and unlock weak sets and weak tables
  during a fork().

* libguile/weak-set.h (scm_weak_set_prehistory): New internal API.
* libguile/init.c: Add call to scm_weak_set_prehistory().

12 years agoMerge remote-tracking branch 'local-2.0/stable-2.0'
Andy Wingo [Fri, 17 Feb 2012 09:21:50 +0000 (10:21 +0100)]
Merge remote-tracking branch 'local-2.0/stable-2.0'

Conflicts:
libguile/read.c
libguile/srcprop.c
module/ice-9/psyntax-pp.scm

12 years agoremove deprecated features test
Andy Wingo [Wed, 15 Feb 2012 22:40:42 +0000 (23:40 +0100)]
remove deprecated features test

* test-suite/tests/procprop.test ("procedure-arity"): Remove a test of
  deprecated features.

12 years agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Wed, 15 Feb 2012 22:04:53 +0000 (23:04 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

Conflicts:
module/ice-9/psyntax-pp.scm

12 years agoAdd tests to verify that 'read' sets source properties when appropriate
Mark H Weaver [Wed, 15 Feb 2012 17:23:12 +0000 (12:23 -0500)]
Add tests to verify that 'read' sets source properties when appropriate

* test-suite/tests/srcprop.test (source properties): Add tests.

12 years agoAdd support for source properties on non-immediate numbers
Mark H Weaver [Wed, 15 Feb 2012 16:47:31 +0000 (11:47 -0500)]
Add support for source properties on non-immediate numbers

* libguile/read.c (scm_read_number): Set source properties on
  non-immediate numbers if the 'positions' reader option is set.

* doc/ref/api-debug.texi (Source Properties): Update manual.

12 years agopsyntax: access source properties for all supported objects
Mark H Weaver [Wed, 15 Feb 2012 04:22:51 +0000 (23:22 -0500)]
psyntax: access source properties for all supported objects

* module/ice-9/psyntax.scm (decorate-source): Set source properties on
  any object that satisfies 'supports-source-properties?'.  Previously
  we used 'pair?' as the predicate.

  (source-annotation): Apply 'source-properties' to _any_ kind of source
  expression, where previously only pairs were queried.  If the argument
  is a syntax-object, apply the source-properties to the syntax-object's
  expression.

  In the peculiar case of a syntax-object whose expression is also a
  syntax-object: previously we would iterate, but with this commit we
  now call 'syntax-object-expression' only once.

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

12 years agoAdd 'supports-source-properties?' predicate
Mark H Weaver [Tue, 14 Feb 2012 07:14:10 +0000 (02:14 -0500)]
Add 'supports-source-properties?' predicate

* libguile/srcprop.c (scm_supports_source_properties_p): New procedure.
  (supports_source_props): New static C function.

* libguile/srcprop.h (scm_supports_source_properties_p): Add prototype.

* doc/ref/api-debug.texi (Source Properties): Add documentation.

12 years agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Wed, 15 Feb 2012 10:43:32 +0000 (11:43 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

12 years agoRelax validation of source property accessors
Mark H Weaver [Tue, 14 Feb 2012 06:54:15 +0000 (01:54 -0500)]
Relax validation of source property accessors

* libguile/srcprop.c (scm_source_properties, scm_source_property,
  scm_i_has_source_properties): Relax validation to allow _any_ object
  to be queried for source properties.

12 years agosyntax-violation: prefer 'subform' for source info, with 'form' as fallback
Mark H Weaver [Wed, 15 Feb 2012 05:41:24 +0000 (00:41 -0500)]
syntax-violation: prefer 'subform' for source info, with 'form' as fallback

* module/ice-9/psyntax.scm (syntax-violation): Look for source
  properties of 'subform' first.  If 'subform' has none, 'form' is used.
  Previously, the source information of 'form' was used unless 'form'
  _itself_ was '#f', in which case 'subform' was used.

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

12 years agoFix psyntax bugs that would cause bad source annotations
Mark H Weaver [Wed, 15 Feb 2012 05:17:18 +0000 (00:17 -0500)]
Fix psyntax bugs that would cause bad source annotations

* module/ice-9/psyntax.scm (rebuild-macro-output): Fix two bugs that
  would cause bogus source properties to be added to vectors and
  macro-introduced syntax objects.  These bugs were masked by the
  limitation that only pairs can be decorated with source properties.
  Due to a typo, each vector in the macro output was decorated using the
  vector itself as its source.  Due to accidental variable capture, each
  syntax-object introduced by the macro had its expression decorated
  with its own wrap-subst.

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

12 years agoFix typo in comment in message.scm: 'know' to 'known' warning types
Mark H Weaver [Mon, 13 Feb 2012 05:06:43 +0000 (00:06 -0500)]
Fix typo in comment in message.scm: 'know' to 'known' warning types

* module/system/base/message.scm (%warning-types): Fix typo.

12 years agobetter handling for exceptions in close-port and port finalizers
Andy Wingo [Tue, 14 Feb 2012 13:33:19 +0000 (14:33 +0100)]
better handling for exceptions in close-port and port finalizers

* libguile/fports.c (close_the_fd, fport_close): Arrange to always close
  the fd, even if the flush procedure throws an exception.  Perhaps the
  port machinery should do this for us, though.  Don't wrap the close
  call in SCM_SYSCALL, EINTR leaves the fd in an unspecified state.
  Don't bother freeing buffers, the collector will handle that; simply
  drop references via scm_port_non_buffer.

* libguile/ports.c (do_free, finalize_port): Catch exceptions caused by
  the free procedure.  Don't bother setting the stream to 0 at all.
  (scm_close_port): Ensure that exceptions thrown by the "close"
  procedure don't prevent the port from being marked as closed.

12 years agoweb server: fix spurious warning
Andy Wingo [Tue, 14 Feb 2012 16:32:16 +0000 (17:32 +0100)]
web server: fix spurious warning

* module/web/server.scm (sanitize-response): Quick fix to the
  304-has-no-body sanitizer.

12 years agoscm_from_stringn utf8 optimization
Andy Wingo [Tue, 14 Feb 2012 08:35:22 +0000 (09:35 +0100)]
scm_from_stringn utf8 optimization

* libguile/strings.c (scm_from_stringn): Optimize scm_from_stringn for
  utf-8.

12 years agofix buggy scm_from_utf8_stringn (!)
Andy Wingo [Tue, 14 Feb 2012 13:24:04 +0000 (14:24 +0100)]
fix buggy scm_from_utf8_stringn (!)

* libguile/strings.c (scm_from_utf8_stringn): Embarassingly, my
  scm_from_utf8_stringn implementation was buggy for non-ascii
  characters, since October (41d1d984).  Fixed.  Will be tested with the
  next patch.

12 years agoports: avoid adding port table entries and finalizers if possible
Andy Wingo [Tue, 14 Feb 2012 13:01:52 +0000 (14:01 +0100)]
ports: avoid adding port table entries and finalizers if possible

* libguile/ports.h (scm_t_port_type_flags, scm_t_ptob_descriptor): Add
  flags to ptob descriptors.

* libguile/ports.c (scm_set_port_flush): Set the SCM_PORT_TYPE_HAS_FLUSH
  flag here.
  (scm_c_make_port_with_encoding): Only add ports to the table if
  SCM_PORT_TYPE_HAS_FLUSH is set.  Only add finalizers to ports if there
  is a free function.
  (scm_close_port): Inline scm_i_remove_port here.  Only remove from the
  weak set if SCM_PORT_TYPE_HAS_FLUSH is set.
  (scm_set_port_revealed_x): Add a comment.

12 years agorefactor port encoding modes: utf-8 and iconv
Andy Wingo [Tue, 14 Feb 2012 12:09:34 +0000 (13:09 +0100)]
refactor port encoding modes: utf-8 and iconv

* libguile/ports.h (struct scm_t_port): Add a flag for the port encoding
  mode: UTF8 or iconv.  The iconv descriptors are now in a separate
  structure so that we can avoid attaching finalizers to the ports
  themselves, in some cases.

* libguile/ports.c (scm_c_make_port_with_encoding): Init the encoding
  mode.
  (scm_i_remove_port): Adapt to call close_iconv_descriptors.
  (finalize_iconv_descriptors, open_iconv_descriptors):
  (close_iconv_descriptors): New infrastructure to manage iconv
  descriptors.
  (scm_i_port_iconv_descriptors): New internal helper.
  (scm_i_set_port_encoding_x): Use open_iconv_descriptors, if needed.
  (get_iconv_codepoint): Use pt->iconv_descriptors.
  (get_codepoint): Check the port encoding mode flags.

* libguile/print.c (display_string_using_iconv): Use
  scm_i_port_iconv_descriptors.
  (display_string): Use pt->encoding_mode flag.

12 years agostring ports simplification
Andy Wingo [Mon, 13 Feb 2012 23:11:39 +0000 (00:11 +0100)]
string ports simplification

* libguile/strports.c (st_fill_input): Rename from stfill_buffer, and
  remove an unneeded scm_return_first_int.
  (st_resize_port): Minor variable renaming.
  (st_write): Keep read_pos updated to be the same as write_pos.  If we
  need to resize, do so only once.
  (st_seek): No more need to flush.
  (st_truncate): Update read_pos here too.
  (scm_mkstrport): No need to flush here.
  (scm_strport_to_string): Just call scm_from_stringn; rely on it to
  detect the latin1 case.
  (scm_make_stptob): No more flush function.

12 years agoweaks: move an allocation outside a critical section
Andy Wingo [Mon, 13 Feb 2012 14:29:21 +0000 (15:29 +0100)]
weaks: move an allocation outside a critical section

* libguile/weak-set.c (resize_set):
* libguile/weak-table.c (resize_table): Drop the set/table lock while
  allocating the new vector.  Fixes a bug in which a finalizer could
  recursively try to grab the port table lock.

12 years agoFix manual: scm_foreign_to_bytevector to scm_pointer_to_bytevector
Mark H Weaver [Sun, 12 Feb 2012 22:05:28 +0000 (17:05 -0500)]
Fix manual: scm_foreign_to_bytevector to scm_pointer_to_bytevector

* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Fix outdated
  function name: scm_foreign_to_bytevector to scm_pointer_to_bytevector.

12 years agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Sun, 12 Feb 2012 12:32:56 +0000 (13:32 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

12 years agoweb server: do not provide a response body where it is not permitted
Andy Wingo [Sun, 12 Feb 2012 12:17:11 +0000 (13:17 +0100)]
web server: do not provide a response body where it is not permitted

* module/web/response.scm (response-must-not-include-body?): New
  function.

* doc/ref/web.texi: Doc the function.

* module/web/server.scm (sanitize-response): Error if we have a body,
  but the response type does not permit a body.  If we are responding to
  a HEAD request, silently drop the body.

12 years agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Sat, 11 Feb 2012 17:28:37 +0000 (18:28 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

12 years agoweb server: print backtrace on errors when run in batch mode
Andy Wingo [Sat, 11 Feb 2012 17:27:56 +0000 (18:27 +0100)]
web server: print backtrace on errors when run in batch mode

* module/web/server.scm (read-client, handle-request, write-client):
  When run in batch mode, give a full backtrace for errors.

12 years agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Sat, 11 Feb 2012 17:14:48 +0000 (18:14 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

Conflicts:
libguile/read.c
test-suite/tests/tree-il.test

12 years agomore efficient scm_string_to_utf8, scm_string_to_utf32
Andy Wingo [Thu, 9 Feb 2012 22:15:25 +0000 (23:15 +0100)]
more efficient scm_string_to_utf8, scm_string_to_utf32

* libguile/bytevectors.c (scm_string_to_utf8): More efficient
  implementation.
  (scm_string_to_utf32): Likewise.

12 years agomore efficient scm_to_utf8_stringn, scm_to_utf32_stringn
Andy Wingo [Thu, 9 Feb 2012 22:14:11 +0000 (23:14 +0100)]
more efficient scm_to_utf8_stringn, scm_to_utf32_stringn

* libguile/strings.c (scm_to_utf8_stringn): More efficient
  implementation than calling scm_to_stringn.
  (scm_to_utf32_stringn): Likewise.

12 years agoSupport => within case, and improve error messages for cond and case
Mark H Weaver [Wed, 8 Feb 2012 00:40:29 +0000 (19:40 -0500)]
Support => within case, and improve error messages for cond and case

* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case,
  with improved error messages and support for '=>' within 'case' as
  mandated by the R7RS.  Add warnings for duplicate case datums and
  case datums that cannot be meaningfully compared using 'eqv?'.

* module/system/base/message.scm (%warning-types): Add 'bad-case-datum'
  and 'duplicate-case-datum' warning types.

* test-suite/tests/syntax.test (cond, case): Update tests to reflect
  improved error reporting.  Add tests for '=>' within 'case'.

* test-suite/tests/tree-il.test (partial evaluation): Update tests to
  reflect changes in how 'case' is expanded.

* doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.

12 years agoAdd source properties to many more types of data
Mark H Weaver [Wed, 8 Feb 2012 20:51:38 +0000 (15:51 -0500)]
Add source properties to many more types of data

* libguile/read.c (scm_read_array): New internal helper that
  calls scm_i_read_array and sets its source property if the
  'positions' reader option is set.

  (scm_read_string): Set source properties on strings if the 'positions'
  reader option is set.

  (scm_read_vector, scm_read_srfi4_vector, scm_read_bytevector,
  scm_read_guile_bitvector, scm_read_sharp): Add new arguments for the
  'line' and 'column' of the first character of the datum being read.
  Set source properties if the 'positions' reader option is set.

  (scm_read_expression): Pass 'line' and 'column' to scm_read_sharp.

* doc/ref/api-debug.texi (Source Properties): Update manual.

12 years agoUnoptimize 'read' to return freshly allocated empty strings
Mark H Weaver [Wed, 8 Feb 2012 20:32:55 +0000 (15:32 -0500)]
Unoptimize 'read' to return freshly allocated empty strings

* libguile/read.c (scm_read_string): Return a freshly allocated string
  every time, even for empty strings.  The motivation is to allow source
  properties to be added to all strings.  Previously, the shared global
  'scm_nullstr' was returned for empty strings.  Note that empty strings
  still share a common global 'null_stringbuf'.

* test-suite/tests/srfi-13.test (substring/shared): Fix tests to reflect
  the fact that empty string literals are no longer guaranteed to be
  'eq?' to each other.

12 years agoOptimize empty substring case of scm_i_substring_copy
Mark H Weaver [Wed, 8 Feb 2012 20:29:10 +0000 (15:29 -0500)]
Optimize empty substring case of scm_i_substring_copy

* libguile/strings.c (scm_i_substring_copy): When asked to create an
  empty substring, use 'scm_i_make_string' to make use of its
  optimization for empty strings that reuses the global null_stringbuf.

12 years agoAdd and use maybe_annotate_source helper in read.c
Mark H Weaver [Wed, 8 Feb 2012 08:10:11 +0000 (03:10 -0500)]
Add and use maybe_annotate_source helper in read.c

* libguile/read.c (maybe_annotate_source): New static helper function.
  (scm_read_sexp, scm_read_quote, scm_read_syntax): Use
  'maybe_annotate_source'.

12 years agoRemove inline and register attributes from read.c
Mark H Weaver [Wed, 8 Feb 2012 08:00:15 +0000 (03:00 -0500)]
Remove inline and register attributes from read.c

* libguile/read.c: Remove all 'inline' and 'register' attributes.

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 agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Wed, 8 Feb 2012 11:25:10 +0000 (12:25 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

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 agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Wed, 8 Feb 2012 10:48:08 +0000 (11:48 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

Conflicts:
GUILE-VERSION
libguile/gc-malloc.c
libguile/ports.c

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 agoRevert "add SCM_HEAP_OBJECT_BASE"
Andy Wingo [Tue, 31 Jan 2012 21:58:24 +0000 (22:58 +0100)]
Revert "add SCM_HEAP_OBJECT_BASE"

This reverts commit 47ed8656db8800f3ad20a40eb2c4e9ef3dc891e3.

Conflicts:

libguile/foreign.c

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 ago"fix" local-eval for introduced toplevels
Andy Wingo [Mon, 30 Jan 2012 19:28:10 +0000 (20:28 +0100)]
"fix" local-eval for introduced toplevels

* module/ice-9/local-eval.scm: Fix for introduced toplevel identifiers.

12 years agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Mon, 30 Jan 2012 18:59:08 +0000 (19:59 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

Conflicts:
libguile/debug.h
module/ice-9/psyntax-pp.scm
module/ice-9/psyntax.scm
module/language/tree-il/peval.scm
module/language/tree-il/primitives.scm

12 years agoMerge commit '3d51e57cfb0404db568a6adfde2a346d3fd9907e'
Andy Wingo [Mon, 30 Jan 2012 17:52:46 +0000 (18:52 +0100)]
Merge commit '3d51e57cfb0404db568a6adfde2a346d3fd9907e'

Conflicts:
libguile/foreign.c
libguile/hashtab.c
module/ice-9/psyntax-pp.scm
module/language/tree-il/compile-glil.scm

12 years agoMerge commit '9b0975f1dc41ddd10d81fb5b0965b9e9a54ef37a'
Andy Wingo [Mon, 30 Jan 2012 17:25:07 +0000 (18:25 +0100)]
Merge commit '9b0975f1dc41ddd10d81fb5b0965b9e9a54ef37a'

Conflicts:
libguile/foreign.c
module/ice-9/psyntax-pp.scm
module/ice-9/psyntax.scm

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.