bpt/guile.git
12 years agoadd effects
Andy Wingo [Thu, 12 Apr 2012 23:25:45 +0000 (16:25 -0700)]
add effects

* module/language/tree-il/effects.scm: New module, for effects
  analysis.
* module/Makefile.am: Adapt.

12 years agopeval tests into separate file
Andy Wingo [Wed, 11 Apr 2012 18:43:00 +0000 (11:43 -0700)]
peval tests into separate file

* test-suite/tests/tree-il.test ("partial evaluation"):
* test-suite/tests/peval.test ("partial evaluation"): Separate peval
* tests.

* test-suite/Makefile.am: Adapt.

12 years agoadd more primitives and predicates to (language tree-il primitives)
Andy Wingo [Tue, 10 Apr 2012 22:47:21 +0000 (15:47 -0700)]
add more primitives and predicates to (language tree-il primitives)

* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*): Add number? and char?.  Add more
  numeric predicates.  Add character comparators.  Add throw, error, and
  scm-error.
  (*primitive-accessors*): Remove struct-vtable.  Though the vtable's
  contents may change (through redefinition), its identity does not
  change.
  (*effect-free-primitives*): Put struct-vtable, number?, and char?
  here.
  (*multiply-valued-primitives*): Instead of listing singly-valued
  primitives, list multiply-valued primitives.
  (*bailout-primitives*): New list.
  (*negatable-primitives*): New alist.
  (*bailout-primitive-table*, *multiply-valued-primitive-table*)
  (*negatable-primitive-table*): New tables.
  (singly-valued-primitive?): Adapt to
  use *multiply-valued-primitive-table*.
  (bailout-primitive?, negate-primitive): New exported procedures.

12 years agomodernize (benchmark-suite lib)
Andy Wingo [Mon, 23 Apr 2012 08:42:09 +0000 (04:42 -0400)]
modernize (benchmark-suite lib)

* benchmark-suite/benchmark-suite/lib.scm: Rewrite to be more modern,
  using parameters, records, and higher precision timers.  Since this
  file was never installed, this is an acceptable interface change.
  (run-benchmark): Run the thunk once before going into the benchmark.
  Adapt to new `report' interface.
  (report): Change to expect only one argument, a <benchmark-result>
  object.
  (print-result): Adapt.  The result is in the same format as before.
  (print-user-result): Adapt.  The result is different from before, but
  as this is just printed on stdout and not logged, there should be no
  problem.
  (calibrate-benchmark-framework): Pull initialization into a function.

12 years agoavoid inexact iteration count in benchmarks
Andy Wingo [Mon, 23 Apr 2012 08:27:34 +0000 (04:27 -0400)]
avoid inexact iteration count in benchmarks

* benchmark-suite/benchmarks/arithmetic.bm:
* benchmark-suite/benchmarks/r6rs-arithmetic.bm: Use #e1e7 for the
  iteration count, instead of the flonum 1e7.

12 years agomove (test-suite lib) to lower dir; cleans up uninstalled paths.
Andy Wingo [Sat, 21 Apr 2012 21:06:48 +0000 (17:06 -0400)]
move (test-suite lib) to lower dir; cleans up uninstalled paths.

* check-guile.in:
* test-suite/Makefile.am:
* test-suite/test-suite/lib.scm:

* benchmark-guile.in:
* benchmark-suite/Makefile.am:
* benchmark-suite/benchmark-suite/lib.scm: Lower the lib modules in the
  source tree.  This lets us remove top_srcdir and top_builddir from the
  uninstalled paths.

* test-suite/tests/asm-to-bytecode.test:
* test-suite/tests/brainfuck.test:
* test-suite/tests/compiler.test:
* test-suite/tests/ftw.test:
* test-suite/tests/gc.test:
* test-suite/tests/match.test:
* test-suite/tests/rnrs-libraries.test:
* test-suite/tests/rnrs-test-a.scm:
* test-suite/tests/sxml.match.test: Adapt to not expect that module
  names be prefixed with "test-suite".

12 years agoThank Klaus.
Ludovic Courtès [Sat, 21 Apr 2012 21:08:49 +0000 (23:08 +0200)]
Thank Klaus.

12 years agobytevectors: Fix IEEE-754 endianness conversion.
Ludovic Courtès [Sat, 21 Apr 2012 21:08:49 +0000 (23:08 +0200)]
bytevectors: Fix IEEE-754 endianness conversion.

Fixes <http://bugs.gnu.org/11310>.
Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.

* libguile/ieee-754.h: Remove.
* libguile/Makefile.am (noinst_HEADERS): Remove `ieee-754.h'.

* libguile/bytevectors.c (scm_ieee754_float, scm_ieee754_double): New
  unions.
  (float_to_foreign_endianness, float_from_foreign_endianness,
  double_to_foreign_endianness, double_from_foreign_endianness): Rewrite
  in terms of the new unions.

* test-suite/tests/bytevectors.test ("2.8 Operations on IEEE-754
  Representations")["single, little endian", "single, big endian",
  "double, little endian", "double, big endian"]: New tests.

12 years agoFix and clarify documentation of `sorted?'.
Ludovic Courtès [Sat, 21 Apr 2012 21:08:49 +0000 (23:08 +0200)]
Fix and clarify documentation of `sorted?'.

Fixed <http://bugs.gnu.org/11262>.
Reported by Alexei Matveev <alexei.matveev@gmail.com>.

* libguile/sort.c (scm_sorted_p): Fix and clarify docstring.
* doc/ref/api-utility.texi (Sorting): Update accordingly.

12 years agoRemove duplicate test in `tree-il.test'.
Ludovic Courtès [Sat, 21 Apr 2012 21:08:49 +0000 (23:08 +0200)]
Remove duplicate test in `tree-il.test'.

* test-suite/tests/tree-il.test ("partial evaluation"): Remove duplicate
  test for `(cons 0 (cons 1 (cons 2 (list 3 4 5))))'.

12 years agoAvoid use of `GC_PTR' in "smob.h".
Ludovic Courtès [Thu, 12 Apr 2012 21:16:48 +0000 (23:16 +0200)]
Avoid use of `GC_PTR' in "smob.h".

Commit c46fee438cf9f4a3449e8d04e7a54805517fd092 removed the "bdw-gc.h"
include from "smob.h", so better avoid `GC_PTR'.

* libguile/smob.c (scm_i_finalize_smob): Use `void *' instead of `GC_PTR'.
* libguile/smob.h (scm_i_finalize_smob): Update declaration accordingly.

12 years agoSRFI-9: Set the `record-constructor' slot of the RTD.
Ludovic Courtès [Mon, 9 Apr 2012 22:17:39 +0000 (00:17 +0200)]
SRFI-9: Set the `record-constructor' slot of the RTD.

Fixed <http://bugs.gnu.org/11196>.
Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.

* module/srfi/srfi-9.scm (define-record-type): Define the contructor
  before TYPE-NAME.  Set RTD's constructor field.

* test-suite/tests/srfi-9.test ("record compatibility"): New test
  prefix.

12 years agoFix scm_to_utf8_stringn once and for all; optimize; add tests
Mark H Weaver [Wed, 4 Apr 2012 22:58:44 +0000 (18:58 -0400)]
Fix scm_to_utf8_stringn once and for all; optimize; add tests

* libguile/strings.c (scm_to_utf8_stringn): Fix another new bug in this
  recent comedy of errors: pass the size of the preallocated buffer to
  u32_to_u8.  Arrange to call 'scm_i_string_wide_chars' and
  'scm_i_string_length' only once each.  Rename local variables for
  improved code clarity.

* test-suite/standalone/test-conversion.c (test_to_utf8_stringn): New
  function to test scm_to_utf8_stringn.

12 years agoFix scm_to_utf8_stringn to NUL-terminate properly
Mark H Weaver [Tue, 3 Apr 2012 13:50:20 +0000 (09:50 -0400)]
Fix scm_to_utf8_stringn to NUL-terminate properly

* libguile/strings.c (scm_to_utf8_stringn): NUL-terminate using the
  correct pointer.

12 years agoFix scm_to_utf8_stringn to return the length in bytes, et al
Mark H Weaver [Mon, 2 Apr 2012 22:55:45 +0000 (18:55 -0400)]
Fix scm_to_utf8_stringn to return the length in bytes, et al

* libguile/strings.c (u32_u8_length_in_bytes): Internal static function
  renamed from u32_u8_strlen, whose name was potentially confusing.  For
  added safety, handle everything that can be encoded in the more
  general UTF-8 encoding: up to six bytes for each code point, with code
  points up to 2^31-1.

  (scm_to_utf8_stringn): NUL-terminate only if (lenp == NULL).
  If (lenp != NULL) return the length in bytes in *lenp.

12 years agofix scm_to_utf8_stringn for wide strings to NUL-append the strings
Andy Wingo [Sun, 1 Apr 2012 18:29:41 +0000 (11:29 -0700)]
fix scm_to_utf8_stringn for wide strings to NUL-append the strings

* libguile/strings.c (u32_u8_strlen, scm_to_utf8_stringn): Sigh, fix the
  u32-to-u8 optimization to ensure that the utf8 string is
  NUL-terminated.

12 years agoprimitive resolution for public refs
BT Templeton [Sat, 10 Mar 2012 08:31:58 +0000 (03:31 -0500)]
primitive resolution for public refs

* module/language/tree-il/primitives.scm (resolve-primitives!): Resolve
  public module-refs to primitives.

* test-suite/tests/tree-il.test: New tests for primitive resolution.

12 years agoadd bad-request printer
Andy Wingo [Sun, 11 Mar 2012 09:57:05 +0000 (10:57 +0100)]
add bad-request printer

* module/web/request.scm (bad-request-printer): Add printer for these
  exceptions.

12 years agoadd exception printers for bad-header, bad-header-component
Andy Wingo [Sun, 11 Mar 2012 09:24:08 +0000 (10:24 +0100)]
add exception printers for bad-header, bad-header-component

* module/web/http.scm (bad-header-component): Throw
  'bad-header-component instead of 'bad-header.
  (bad-header-printer, bad-header-component-printer): Add exception
  printers.

12 years agomicro-optimizations to string-trim-both, and to (web http)
Andy Wingo [Wed, 7 Mar 2012 11:39:30 +0000 (12:39 +0100)]
micro-optimizations to string-trim-both, and to (web http)

* libguile/srfi-13.c (scm_string_trim, scm_string_trim_right)
  (scm_string_trim_both): Take the whitespace fast-path if the char_pred
  is scm_char_set_whitespace.

* module/web/http.scm (read-header, split-and-trim, parse-quality-list):
  (parse-param-component, parse-credentials, "Content-Type"):
  (read-request-line, read-response-line): Use char-set:whitespace
  instead of char-whitespace?.  It avoids recursing into the VM.

12 years agomake applicable smob calls cheaper, and fix a memory leak
Andy Wingo [Sun, 18 Mar 2012 19:04:28 +0000 (20:04 +0100)]
make applicable smob calls cheaper, and fix a memory leak

* libguile/vm.c (prepare_smob_call): New helper.  Now, instead of making
  a per-smob trampoline, we will shuffle the smob into the args and use
  a gsubr.  This prevents a memory leak in which the trampolines, which
  were values in a weak-key table, were preventing the smobs from being
  collected.

* libguile/vm-i-system.c (call, tail-call, mv-call): Adapt to new smob
  application mechanism.
  (smob-call): Remove this instruction.

* libguile/smob.h (scm_smob_descriptor): Rename apply_trampoline_objcode
  to apply_trampoline.

* libguile/smob.c: Remove our own objcode trampolines in favor of using
  scm_c_make_gsubr.
  (scm_smob_prehistory): No more trampoline weak map.

* libguile/procprop.c (scm_i_procedure_arity): Adapt to applicable smob
  representation change.

12 years agoweb http: fix Ma -> Mar
Andy Wingo [Mon, 12 Mar 2012 15:58:15 +0000 (16:58 +0100)]
web http: fix Ma -> Mar

* module/web/http.scm (write-date): Fix serialization of Mar.  Oops.

12 years agoweb server http: 400 Bad Request on bad requests
Andy Wingo [Sun, 11 Mar 2012 09:29:06 +0000 (10:29 +0100)]
web server http: 400 Bad Request on bad requests

* module/web/server/http.scm (bad-request, http-read): If an exception
  is raised while reading a response, write out a 400 Bad Request
  response before closing the port.

12 years agomore libgc 7.1 compat
Andy Wingo [Thu, 8 Mar 2012 22:50:41 +0000 (23:50 +0100)]
more libgc 7.1 compat

* configure.ac:
* libguile/gc.c (GC_set_finalize_on_demand): Check for this function,
  and shim if it isn't present.

12 years agorun finalizers asynchronously in asyncs
Andy Wingo [Fri, 24 Feb 2012 12:18:48 +0000 (13:18 +0100)]
run finalizers asynchronously in asyncs

* libguile/finalizers.c: New excitement!  We'll be running finalizers
  asynchronously, from asyncs.  This will make it safer to allocate
  while holding a mutex.
  (GC_set_finalizer_notifier): Add back-compat shim.

* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
  during boot.

* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
  on demand.
  (scm_gc): Explicitly run finalizers here.

* libguile/threads.c (guilify_self_2): Run finalizers here if
  queue_finalizer_async happened to run during guilify_self_1.

* configure.ac: Add check for GC_set_finalizer_notifier.

12 years agouse the new finalizer helpers
Andy Wingo [Sun, 19 Feb 2012 11:23:29 +0000 (12:23 +0100)]
use the new finalizer helpers

* libguile/foreign.c (scm_set_pointer_finalizer_x)
* libguile/ports.c (finalize_port)
* libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob)
* libguile/struct.c (scm_i_alloc_struct)
* libguile/numbers.c (make_bignum): Use the new API.

12 years agoadd scm_i_set_finalizer, scm_i_add_finalizer, scm_i_add_resuscitator
Andy Wingo [Sun, 19 Feb 2012 11:22:12 +0000 (12:22 +0100)]
add scm_i_set_finalizer, scm_i_add_finalizer, scm_i_add_resuscitator

* libguile/finalizers.h:
* libguile/finalizers.c: New files.

* libguile.h:
* libguile/Makefile.am: Add to build.

12 years agoscm_new_smob, scm_new_double_smob inline functions
Andy Wingo [Thu, 26 May 2011 14:49:47 +0000 (16:49 +0200)]
scm_new_smob, scm_new_double_smob inline functions

* libguile/smob.h (scm_new_smob, scm_new_double_smob): New constructors,
  which do what SCM_NEWSMOB / SCM_NEWSMOB3 had done, but with inline
  functions instead of macros.  They also bail to scm_i_new_smob /
  scm_i_new_double_smob in either the mark or the free case, so that the
  inline definition doesn't reference other internal details like libgc
  stuff.
  (SCM_SMOB_TYPE_MASK et al): Move definitions up so the new_smob see
  them as already being declared.
  (SCM_NEWSMOB, SCM_RETURN_NEWSMOB, SCM_NEWSMOB2, SCM_RETURN_NEWSMOB2):
  (SCM_NEWSMOB3, SCM_RETURN_NEWSMOB3): Reimplement in terms of the new
  inline functions.

  Remove now-unneeded bdw-gc include.

* libguile/smob.c (finalize_smob): Rename from scm_i_finalize_smob, and
  make static.
  (scm_i_new_smob, scm_i_new_double_smob): Slow-path allocators.
  (scm_i_finalize_smob, scm_i_new_smob_with_mark_proc): Add
  back-compatibility shims to preserve ABI.

* libguile/inline.c: Include smob.h, so as to reify scm_new_smob and
  scm_new_double_smob.

12 years agoscm_cell, scm_double_cell, scm_words back to gc.h
Andy Wingo [Thu, 26 May 2011 14:08:02 +0000 (16:08 +0200)]
scm_cell, scm_double_cell, scm_words back to gc.h

* libguile/inline.h:
* libguile/gc.h (scm_cell, scm_double_cell, scm_words): Move
  declarations and definitions back here, from inline.h.  It's more
  natural.

* libguile/inline.c: Include gc.h as well.

12 years agosimplify inline function infrastructure
Andy Wingo [Thu, 26 May 2011 13:53:02 +0000 (15:53 +0200)]
simplify inline function infrastructure

* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
  from inline.h.  We'd like to support inline function definitions in
  more header files: not just inline.h.
  (SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
  definitions.

* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
  wrappers, which redirect to the GC_MALLOC macros when building Guile,
  and the scm_gc_malloc functions otherwise.  A step towards getting
  BDW-GC out of Guile's API.

* libguile/inline.h: Simplify, using SCM_INLINE,
  SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES.  Also use the
  new SCM_GC_MALLOC macros.

12 years agoFix flush on soft ports, so that it actually runs.
Ian Price [Fri, 27 Jan 2012 06:38:09 +0000 (06:38 +0000)]
Fix flush on soft ports, so that it actually runs.

* libguile/vports.c (sf_flush): Remove conditional testing the
  position in the port's write_buf, as it is no longer used.

12 years agoImprove port benchmark.
Ludovic Courtès [Wed, 7 Mar 2012 20:57:58 +0000 (21:57 +0100)]
Improve port benchmark.

* benchmark-suite/benchmarks/ports.bm (sequence): New macro, formerly
  local to the "rdelim" benchmark prefix.
  (large-string): New procedure.
  (%latin1-port, %utf8/ascii-port, %utf8/wide-port): Use it.
  ("peek-char", "char-ready?", "read-char"): Use `sequence'.

12 years agoFix a segfault when /dev/urandom is not accessible
Giuseppe Scrivano [Tue, 21 Feb 2012 14:55:44 +0000 (15:55 +0100)]
Fix a segfault when /dev/urandom is not accessible

* libguile/init.c (scm_i_init_guile): Call `scm_init_random' before
`scm_init_macros'.

12 years agodeprecate close-io-port
Andy Wingo [Mon, 5 Mar 2012 22:52:00 +0000 (23:52 +0100)]
deprecate close-io-port

* module/ice-9/r4rs.scm:
* module/ice-9/deprecated.scm (close-io-port): Deprecate.

12 years agoDon't call SYMBOL_STRINGBUF on a string
Mark H Weaver [Mon, 5 Mar 2012 03:47:04 +0000 (22:47 -0500)]
Don't call SYMBOL_STRINGBUF on a string

* libguile/strings.c (scm_i_make_symbol): Use STRING_STRINGBUF
  instead of SYMBOL_STRINGBUF to get the stringbuf of a string.

12 years agoRemove documentation of internal static string comparison functions
Mark H Weaver [Mon, 5 Mar 2012 03:12:48 +0000 (22:12 -0500)]
Remove documentation of internal static string comparison functions

* doc/ref/api-data.texi (String Comparison): Remove documentation for
  scm_i_string{,_ci}_{equal,less,leq,gr,geq}_p, which are not only
  internal functions but static, and thus unusable by external code.

12 years agoComment out unused definitions of 'do' and 'case' in psyntax.scm
Mark H Weaver [Sun, 4 Mar 2012 17:01:10 +0000 (12:01 -0500)]
Comment out unused definitions of 'do' and 'case' in psyntax.scm

* module/ice-9/psyntax.scm (do, case): Comment out these definitions,
  which are never used and immediately replaced by definitions in
  boot-9.scm.

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

12 years agoFix syntax wrap comments; remove old unused cruft
Mark H Weaver [Sun, 4 Mar 2012 16:53:23 +0000 (11:53 -0500)]
Fix syntax wrap comments; remove old unused cruft

* module/ice-9/psyntax.scm (subst-rename?, rename-old, rename-new,
  rename-marks, make-rename): Remove these unused syntax rules.
  Fix description of syntax wraps to match current reality.

12 years agoMinimize size of embedded syntax objects in psyntax-pp.scm
Mark H Weaver [Fri, 2 Mar 2012 23:40:43 +0000 (18:40 -0500)]
Minimize size of embedded syntax objects in psyntax-pp.scm

* module/ice-9/compile-psyntax.scm: Minimize syntax object literals
  embedded in psyntax-pp.scm.

* module/ice-9/psyntax.scm: Rename a few variables so that syntax
  objects embedded in macros have no lexical bindings, so that their
  minimized syntax objects will have no embedded labels.  These labels
  were the last remaining gensym counters in psyntax-pp.scm.

* module/ice-9/psyntax-pp.scm: Regenerate.  It is now less than one
  quarter of its previous size!  More importantly, this file no longer
  contains any gensym counters, which means that in the future, local
  changes to psyntax.scm will usually result in only local changes to
  psyntax-pp.scm.

12 years agotree-il->scheme improvements
Mark H Weaver [Thu, 1 Mar 2012 22:56:14 +0000 (17:56 -0500)]
tree-il->scheme improvements

* module/language/tree-il.scm (tree-il->scheme): New implementation that
  simply calls 'decompile-tree-il'.

* module/language/scheme/decompile-tree-il.scm (choose-output-names,
  do-decompile): New internal procedures.

  (decompile-tree-il): New and improved implementation.  Print source
  identifiers where possible, otherwise add minimal numeric suffixes.
  Previously we printed the gensyms.  Avoid 'begin' in contexts that
  provide an implicit 'begin'.  Produce 'cond', 'case', 'and', 'or',
  'let*', named let, and internal defines where appropriate.  Recognize
  keyword arguments in 'opts' to disable the production of these derived
  syntactic forms, and to optionally strip numeric suffixes from
  variable names.

* module/ice-9/compile-psyntax.scm: Disable partial evaluation, letrec
  fixing, and primitive expansion when producing psyntax-pp.scm, in
  order to produce output as close to the original source as practical.
  Disable production of derived syntactic forms as needed during
  bootstrap.  Strip numeric suffixes from variable names.  Adjust
  pretty-printing parameters.

* module/ice-9/psyntax-pp.scm: Regenerate.  It is now less than half
  of the original size.

12 years agopretty-print: allow max-expr-width to be set; recognize more keywords
Mark H Weaver [Sun, 26 Feb 2012 20:58:30 +0000 (15:58 -0500)]
pretty-print: allow max-expr-width to be set; recognize more keywords

* module/ice-9/pretty-print.scm (pretty-print): Add new keyword argument
  '#:max-expr-width'.

  (generic-write): Add new argument 'max-expr-width'.  Previously this
  was internally defined to the constant value 50.

12 years agoFix typos in psyntax.scm
Mark H Weaver [Fri, 2 Mar 2012 22:54:23 +0000 (17:54 -0500)]
Fix typos in psyntax.scm

* module/ice-9/psyntax.scm (gen-syntax-case): #'pad --> #'pat
  (define*): #'x --> #'id

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

12 years agotweaks to -Wformat's gettext detection
Andy Wingo [Fri, 2 Mar 2012 16:46:28 +0000 (17:46 +0100)]
tweaks to -Wformat's gettext detection

* module/language/tree-il/analyze.scm (proc-ref?): Change to use less
  false-if-exception and more variable-bound?.  If a variable is present
  in the local module but not bound, assume that it is gettext if it has
  the right name.  This is to allow for (define _ gettext).

* test-suite/tests/tree-il.test ("warnings"): Update (_ "foo") example.

12 years agopeval: inline applications of lambda to rest args
Andy Wingo [Fri, 2 Mar 2012 14:51:05 +0000 (15:51 +0100)]
peval: inline applications of lambda to rest args

* module/language/tree-il/peval.scm (peval): Add optimization to
  hoist the inner procedure out of e.g.
    (lambda args (apply (lambda ...) args))
  This commit restores the ability to detect escape-only prompts at
  compile-time.

* test-suite/tests/tree-il.test: Update test for prompt with a lambda,
  and add a specific test for lambda application.

12 years agotree-il: fix `canonicalize!' for prompts
Andy Wingo [Fri, 2 Mar 2012 15:39:56 +0000 (16:39 +0100)]
tree-il: fix `canonicalize!' for prompts

* module/language/tree-il/canonicalize.scm (canonicalize!): Fix a bug in
  which the sense of `escape-only?' was reversed.  We never saw this
  though, because for other reasons, no prompts were being identified as
  escape-only.

12 years agomore general treatment of call-with-prompt
Andy Wingo [Fri, 2 Mar 2012 12:02:19 +0000 (13:02 +0100)]
more general treatment of call-with-prompt

* module/language/tree-il/primitives.scm (*primitive-expand-table*):
  Don't limit the call-with-prompt to <prompt> transition to lambda
  expressions.  Instead we can lexically bind the handler, and rely on
  peval to propagate a lambda expression.

12 years agopmatch: always wrap with let, even if the expression appears atomic
Mark H Weaver [Sun, 26 Feb 2012 20:53:11 +0000 (15:53 -0500)]
pmatch: always wrap with let, even if the expression appears atomic

* module/system/base/pmatch.scm (pmatch): Always wrap with 'let', even
  if the expression appears atomic, because in the presence of
  'identifier-syntax', we cannot know what an atomic expression will
  later expand to.  Also use '#:export-syntax' instead of '#:export'
  to export 'pmatch'.

12 years agoFix <TAG>vector-length when applied to other uniform vector types
Mark H Weaver [Thu, 1 Mar 2012 21:07:28 +0000 (16:07 -0500)]
Fix <TAG>vector-length when applied to other uniform vector types

* module/srfi/srfi-4.scm, module/srfi/srfi-4/gnu.scm
  (define-bytevector-type): Fix definition of <TAG>vector-length when
  applied to uniform vectors of different element sizes.  Thanks to
  Tobias Brandt <tob.brandt@googlemail.com> for reporting this bug.

* test-suite/tests/srfi-4.test: Add tests.

12 years agoAvoid failure when `format-analysis' stumbles upon unbound variables.
Ludovic Courtès [Sun, 26 Feb 2012 23:51:09 +0000 (00:51 +0100)]
Avoid failure when `format-analysis' stumbles upon unbound variables.

* module/language/tree-il/analyze.scm (proc-ref?): Wrap `variable-ref'
  in `false-if-exception'.

* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
  format string with forward declaration"): New test.

12 years agosrfi-18 test fix
Andy Wingo [Fri, 24 Feb 2012 19:01:47 +0000 (20:01 +0100)]
srfi-18 test fix

* test-suite/tests/srfi-18.test: Enclose the tests in a begin instead of
  an and.  Before, they were not being run, for some reason I don't
  fully understand.

12 years agoslight cleanup to run-test
Andy Wingo [Fri, 24 Feb 2012 18:58:45 +0000 (19:58 +0100)]
slight cleanup to run-test

* test-suite/lib.scm (run-test): Slight cleanup.

12 years agorewrite open-process in C, for robustness
Andy Wingo [Thu, 23 Feb 2012 12:56:06 +0000 (13:56 +0100)]
rewrite open-process in C, for robustness

* libguile/posix.c (scm_open_process): Rewrite in C, so as to avoid
  allocations and other calls that are not async-signal-safe.
  (scm_init_popen, scm_init_posix): Register popen extension.

* module/ice-9/popen.scm: Load the popen extension, to get open-process.

12 years agomicrooptimizations in (web uri)
Andy Wingo [Wed, 22 Feb 2012 19:40:55 +0000 (20:40 +0100)]
microoptimizations in (web uri)

* module/web/uri.scm (valid-host?): Micro-optimizations.

12 years agoadd test for recent quick fix
Andy Wingo [Wed, 22 Feb 2012 19:08:44 +0000 (20:08 +0100)]
add test for recent quick fix

* test-suite/tests/web-uri.test ("string->uri"): Add test for
  string->uri with hosts beginning in digits.

12 years agoquick fix the quick fix
Andy Wingo [Tue, 21 Feb 2012 16:50:55 +0000 (16:50 +0000)]
quick fix the quick fix

12 years agoquick fix to uri parser
Andy Wingo [Tue, 21 Feb 2012 16:42:53 +0000 (16:42 +0000)]
quick fix to uri parser

* module/web/uri.scm: Quick fix to not throw an error on e.g.
  http://2012.jsconf.us.

12 years agoHave `-Wformat' recognize `ngettext' calls.
Ludovic Courtès [Sun, 19 Feb 2012 22:54:18 +0000 (23:54 +0100)]
Have `-Wformat' recognize `ngettext' calls.

* module/language/tree-il/analyze.scm (gettext?): Rename to...
  (proc-ref?): ... this.  Add `proc' and `special-name' parameters.
  (gettext?): Define in terms of `proc-ref?'.
  (ngettext?): New procedure.
  (const-fmt): Recognize `ngettext' calls.
  (format-analysis)[<down>](check-format-args]: Check
  constant-but-non-string 2nd argument in the (not (const-fmt ...))
  case.
  [check-simple-format-args]: Use `const-fmt'.

* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
  format string using ngettext", "non-literal format string using
  ngettext as N_"): New tests.
  ("simple-format")["unsupported, ngettext"]: New test.

12 years agoHave `-Wformat' better recognize the `gettext' procedure.
Ludovic Courtès [Sun, 19 Feb 2012 22:08:49 +0000 (23:08 +0100)]
Have `-Wformat' better recognize the `gettext' procedure.

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

* module/language/tree-il/analyze.scm (gettext?): New procedure.
  (const-fmt): Add `env' parameter; update callers.  Use `gettext?'.
  (format-analysis)[check-simple-format-args]: Actually support
  gettextized format strings.

* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
  format string using gettext"): Use `gettext' as the procedure name.
  ("non-literal format string using gettext as _"): New test.
  ["simple-format"]("unsupported, gettext"): New test.

12 years agoDon't fail when locale env. vars specify a dot-less locale name.
Ludovic Courtès [Fri, 17 Feb 2012 23:04:17 +0000 (00:04 +0100)]
Don't fail when locale env. vars specify a dot-less locale name.

Fixes <http://bugs.gnu.org/10742>.
Reported by Alírio Eyng <alirioeyng@ig.com.br>.

* gnulib-local/lib/localcharset.c.diff (environ_locale_charset): Change
  to set CODESET to "" when LOCALE lacks a dot.  Return "ISO-8859-1"
  when CODESET is the empty string.

* lib/localcharset.c: Update.

* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
  `test-command-line-encoding2'.
  (TESTS): Likewise.

* test-suite/standalone/test-command-line-encoding2: New file.

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