bpt/guile.git
14 years agoRemove default port/SMOB finalizers.
Ludovic Courtès [Fri, 25 Sep 2009 10:29:02 +0000 (12:29 +0200)]
Remove default port/SMOB finalizers.

* libguile/ports.c (scm_port_free0): Remove.
  (scm_make_port_type): Set `free' to NULL.

* libguile/smob.c (scm_make_smob_type): Leave `free' to NULL.
  (scm_smob_free): Remove.

* libguile/smob.h (scm_smob_free): Remove.

* libguile/deprecated.c (scm_smob_free): New.

* libguile/deprecated.h (scm_smob_free): New declaration.

14 years agoClean meta/guile-config
Neil Jerram [Fri, 25 Sep 2009 23:51:50 +0000 (00:51 +0100)]
Clean meta/guile-config

* meta/Makefile.am (CLEANFILES): New, containing guile-config.

14 years agoDon't include guile-config and guile-tools in distribution
Neil Jerram [Fri, 25 Sep 2009 21:45:17 +0000 (22:45 +0100)]
Don't include guile-config and guile-tools in distribution

They need to be regenerated, with the correct prefix, when configure
and make run.

* meta/Makefile.am (EXTRA_DIST): Remove bin_SCRIPTS.

14 years agoFix make distcheck by looking for guile-config in $(srcdir)
Neil Jerram [Fri, 25 Sep 2009 19:18:34 +0000 (20:18 +0100)]
Fix make distcheck by looking for guile-config in $(srcdir)

make distcheck is currently failing for me with:

In file included from /usr/local/include/libguile/threads.h:35,
                 from /usr/local/include/libguile/async.h:28,
                 from /usr/local/include/libguile.h:37,
                 from ../../examples/box/box.c:22:
/usr/local/include/libguile/pthread-threads.h:33:31: error: libguile/boehm-gc.h: No such file or directory
In file included from /usr/local/include/libguile.h:93,
                 from ../../examples/box/box.c:22:

- which is because it's picking up a load of installed headers,
instead of those in the _inst tree

- which is because there is no output from the preceding guile-config
invocation:

PATH=/home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/bin:$PATH PKG_CONFIG_PATH=/home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/lib/pkgconfig /home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/bin/guile-config compile

- which is because .../_inst/bin/guile-config is empty

- which is because the rule in meta/Makefile.am that generates
guile-config is missing $(srcdir), and so doesn't find
guile-config.in.

* meta/Makefile.am (guile-config): Look for guile-config.in in
  $(srcdir).

14 years agoMissing free in nl-langinfo
Michael Gran [Fri, 25 Sep 2009 14:47:56 +0000 (07:47 -0700)]
Missing free in nl-langinfo

This is a regression.

* libguile/i18n.c (scm_nl_langinfo): free c_result

14 years agoFix encoding of strings returned by nl-langinfo
Michael Gran [Fri, 25 Sep 2009 14:27:11 +0000 (07:27 -0700)]
Fix encoding of strings returned by nl-langinfo

Strings returned by nl-langinfo were always being encoded using the
global setlocale and not the scm_t_locale passed to the function.

* libguile/i18n.c (scm_nl_langinfo): fix encoding of strings

14 years agoLanguage-specific case-conversion doesn't honor locale
Michael Gran [Thu, 24 Sep 2009 15:07:38 +0000 (08:07 -0700)]
Language-specific case-conversion doesn't honor locale

Libunistring uses a function uc_locale_language to extract the
current language from the locale information.  It does this by calling
setlocale.  This makes incompatible with Guile functions that use the
locale_t thread-specific locale API, because the values returned by the
call to setlocale ignore the locale set by uselocale.

As a workaround, this patch extracts the language from the locale_t
structure's __names field.

A more complete solution is needed.  Perhaps that solution would test
that the __names field exists in the configure step and revert to
!USE_GNU_LOCALE_API in that case.

* libguile/i18n.c (locale_language): new function that performs the
  same job as uc_locale_language but is compatible with uselocale
  (u32_locale_casecoll, u32_locale_tocase): replace uc_locale_language
  with locale_language

14 years agoTests for locale-specific case conversion
Michael Gran [Thu, 24 Sep 2009 15:10:03 +0000 (08:10 -0700)]
Tests for locale-specific case conversion

* test-suite/tests/i18n.test: add tests for case conversion of Turkish
  letters 'i' to verify that the language is being honored.

14 years agoTry to adjust i18n for strict aliasing
Michael Gran [Thu, 24 Sep 2009 14:50:49 +0000 (07:50 -0700)]
Try to adjust i18n for strict aliasing

* libguile/i18n.c (u32_locale_tocase, scm_char_locale_downcase)
  (scm_char_locale_upcase, scm_string_locale_downcase)
  (scm_string_locale_upcase): use the scm_t_uint32 type for buffers
  that are used primarily for libunistring and not for Guile strings.

14 years agoMove "-z relro" out of $LDFLAGS so it's not in `guile-2.0.pc'.
Ludovic Courtès [Wed, 23 Sep 2009 22:04:37 +0000 (00:04 +0200)]
Move "-z relro" out of $LDFLAGS so it's not in `guile-2.0.pc'.

* acinclude.m4 (GUILE_GNU_LD_RELRO): Substitute `GNU_LD_FLAGS'.

* libguile/Makefile.am (libguile_la_LDFLAGS): Add $(GNU_LD_FLAGS).

* srfi/Makefile.am (AM_LDFLAGS): New.

14 years agoHave `guile-config' close over `pkg-config' and $(pkgconfigdir).
Ludovic Courtès [Wed, 23 Sep 2009 20:45:07 +0000 (22:45 +0200)]
Have `guile-config' close over `pkg-config' and $(pkgconfigdir).

* meta/Makefile.am (guile-config): New target.
  (EXTRA_DIST): Add `guile-config.in'.

* meta/guile-config.in: New, formerly `guile-config'.  Use the right
  installed `guile', with the right $PKG_CONFIG_PATH.  Disable
  auto-compilation.
  (%pkg-config-program): New variable.
  (pkg-config): Use it.

14 years agoPartially revert e5f5113c21f396705d7479a570c96690135c9d36.
Ludovic Courtès [Wed, 23 Sep 2009 20:13:09 +0000 (22:13 +0200)]
Partially revert e5f5113c21f396705d7479a570c96690135c9d36.

The intent is to maintain the readability of `pmatch' invocations.

* module/language/assembly/disassemble.scm (disassemble-load-program):
  Don't use wildcards in `pmatch' invocations, even when the matched
  elements are unused.

* module/language/glil/decompile-assembly.scm (decompile-toplevel,
  decompile-load-program): Likewise.

* module/system/xref.scm (program-callee-rev-vars): Likewise.

* module/language/assembly.scm (byte-length): Likewise.

* module/language/tree-il/compile-glil.scm (flatten): Likewise.

14 years agoReinstate backward-compatible `scm_array_p ()'.
Ludovic Courtès [Wed, 23 Sep 2009 20:04:55 +0000 (22:04 +0200)]
Reinstate backward-compatible `scm_array_p ()'.

* libguile/generalized-arrays.c (scm_array_p_2): New, formerly
  `scm_array_p ()'.
  (scm_array_p): Add second argument, for compatibility with 1.8 and
  earlier and to match what the doc says and what `SCM_VALIDATE_ARRAY'
  expects.

* libguile/generalized-arrays.h (scm_array_p_2): New.
  (scm_array_p): Adjust.

14 years agoModify char and string locale upcase and downcase for Unicode
Michael Gran [Wed, 23 Sep 2009 04:08:29 +0000 (21:08 -0700)]
Modify char and string locale upcase and downcase for Unicode

* libguile/i18n.c (u32_locale_tocase): new helper function
  (scm_char_locale_downcase, scm_char_locale_upcase): add capability
  for UCS-4 characters.
  (scm_string_locale_downcase, scm_string_locale_upcase): modify for
  the new scheme strings.

14 years agoManual link from `Guile Initialization' to `Initialization'
Neil Jerram [Tue, 22 Sep 2009 00:03:43 +0000 (01:03 +0100)]
Manual link from `Guile Initialization' to `Initialization'

Thanks to Dale Smith for suggesting this.

* doc/ref/libguile-linking.texi: Add ref to full doc of Guile
  initialisation functions.

14 years agoChanges so that benchmark-guile runs successfully
Neil Jerram [Mon, 21 Sep 2009 23:30:44 +0000 (00:30 +0100)]
Changes so that benchmark-guile runs successfully

* benchmark-suite/benchmarks/bytevectors.bm: Add "coding: latin1"
  comment where Guile will find it.

* benchmark-suite/benchmarks/chars.bm: Ditto.

* benchmark-suite/benchmarks/srfi-13.bm: Ditto.

* benchmark-suite/benchmarks/read.bm ("read"): Divide numbers of
  iterations by 10, so that the benchmarks complete within a few
  minutes.

* benchmark-suite/lib.scm (benchmark): Use `run-benchmark' in macro
  definition, not `,run-benchmark'.

* benchmark-suite/benchmarks/0-reference.bm,
  benchmark-suite/benchmarks/continuations.bm,
  benchmark-suite/benchmarks/if.bm,
  benchmark-suite/benchmarks/logand.bm: Add define-module.

* benchmark-suite/results/neil-arudy: New file, containing benchmark
  results from my computer.

14 years agoGDS usability: operation without a mouse
Neil Jerram [Mon, 21 Sep 2009 23:00:59 +0000 (00:00 +0100)]
GDS usability: operation without a mouse

Derek Peschel provided this patch and described it as follows.

"Most of the time I use Terminal in OS X, rather than xterm.  I also don't
bother with the GUI versions of Emacs.  So unfortunately I have no mouse
support in Emacs.  Also the system I'm testing Guile on thinks my terminal
doesn't support color and I haven't fixed it yet.  The attached patch makes
GDS more usable for me.

"With no mouse, the "[click here to show error stack]" design is very
inconvenient.  You added a C-M (return) binding at some point.  I copied
that, but I also changed the message to show it.  And I made the return
work when the cursor is after the right bracket."

* emacs/gds-scheme.el (gds-display-results): Make "click here" message
  more helpful for people without mice.  Also extend text properties
  so that a RET key press works at the end of that line.

14 years agoTypo fixes
Neil Jerram [Sat, 19 Sep 2009 00:23:09 +0000 (01:23 +0100)]
Typo fixes

14 years agoFix GDB in Emacs incantation
Neil Jerram [Sat, 19 Sep 2009 00:20:31 +0000 (01:20 +0100)]
Fix GDB in Emacs incantation

14 years agoTests for record types
Michael Gran [Mon, 21 Sep 2009 03:59:05 +0000 (20:59 -0700)]
Tests for record types

* test-suite/tests/records.test: new tests

14 years agoMore tests for strings
Michael Gran [Mon, 21 Sep 2009 03:58:08 +0000 (20:58 -0700)]
More tests for strings

* test-suite/tests/vectors.test: test make-vector and interactions between
  strings and vectors

* test-suite/tests/strings.test: test string-null?, string? and backslash
  escapes

* test-suite/tests/srfi-13.test: test null input strings in string-any and
  string-every

14 years agoRemove unused variables in system/language.
Ludovic Courtès [Sun, 20 Sep 2009 22:35:19 +0000 (00:35 +0200)]
Remove unused variables in system/language.

* module/language/assembly.scm (byte-length): Don't match unused
  record slots.

* module/language/tree-il.scm (tree-il->scheme, post-order!,
  pre-order!): Likewise.

* module/language/tree-il/analyze.scm (analyze-lexicals): Likewise.

* module/language/tree-il/compile-glil.scm (flatten): Likewise.

* module/language/assembly/disassemble.scm (disassemble-load-program):
  Don't match unused list elements.

* module/language/glil/decompile-assembly.scm (decompile-toplevel,
  decompile-load-program): Likewise.

* module/system/xref.scm (program-callee-rev-vars): Likewise.

* module/language/assembly/compile-bytecode.scm
  (write-bytecode)[write-sized-loader]: Remove.

* module/language/assembly/decompile-bytecode.scm (decode-load-program):
  Factorize `pad' variables.

* module/language/ecmascript/base.scm (object->value/string,
  object->value/number)[v]: Remove.

* module/language/ecmascript/tokenize.scm (read-slash)[c0]: Remove.

* module/language/objcode/spec.scm (decompile-value)[nargs]: Remove.

* module/system/repl/command.scm (time)[vms-start, vms-end]: Remove.

* module/system/repl/repl.scm (prompting-meta-read): Use `prompt'.

14 years agoRemove unused variables in ice-9/goops/srfi/scripts.
Ludovic Courtès [Sun, 20 Sep 2009 22:10:28 +0000 (00:10 +0200)]
Remove unused variables in ice-9/goops/srfi/scripts.

* module/ice-9/boot-9.scm (scm-style-repl)[-abort]: Remove.

* module/oop/goops.scm (class)[slot-defs]: Remove.
  (compute-slot-accessors)[name]: Remove.
  (compute-get-n-set)[env]: Remove.

* module/oop/goops/active-slot.scm (compute-get-n-set)[env, name]:
  Remove.

* module/oop/goops/dispatch.scm (cache-try-hash!)[max-misses]: Remove.

* module/oop/goops/save.scm (make-mapper)[dims]: Remove.

* module/scripts/autofrisk.scm (>>checks)[prog]: Remove.

* module/srfi/srfi-19.scm (priv:read-directives)[ireaderf, eireader4]:
  Remove.

14 years agoHonor and confine expansion-time side-effects to `current-reader'.
Ludovic Courtès [Mon, 17 Aug 2009 20:28:54 +0000 (22:28 +0200)]
Honor and confine expansion-time side-effects to `current-reader'.

* module/language/scheme/spec.scm (scheme)[#:reader]: Honor the
  compilation environment's `current-reader'.

* module/system/base/compile.scm (*compilation-environment*): New
  fluid.
  (current-compilation-environment): New procedure.
  (make-compilation-module): Provide a fresh `current-reader' fluid.
  (read-and-compile): Set `*compilation-environment*' appropriately.
  (compile): Likewise.

* test-suite/tests/compiler.test (read-and-compile): New.
  ("current-reader"): New test prefix.

14 years agoFix copyright in `(srfi srfi-4 gnu)'.
Ludovic Courtès [Sun, 20 Sep 2009 20:29:28 +0000 (22:29 +0200)]
Fix copyright in `(srfi srfi-4 gnu)'.

14 years agoCompile in a fresh module by default.
Ludovic Courtès [Fri, 14 Aug 2009 17:30:14 +0000 (19:30 +0200)]
Compile in a fresh module by default.

* module/system/base/compile.scm (make-compilation-module,
  language-default-environment): New procedures.
  (read-and-compile, compile): Have ENV default to
  `(language-default-environment from)'.
  (compile-and-load): Compile in `(current-module)'.

* module/system/repl/common.scm (repl-compile): Explicitly compile in
  the current module so that macro definitions are visible.

* libguile/load.c (kw_env): New variable.
  (do_try_autocompile): Call `compile-file' with `#:env (current-module)'.

* test-suite/tests/compiler.test ("psyntax")["compile uses a fresh module by
  default", "compile-time definitions are isolated"]: New tests.
  ["compile in current module"]: Specify `#:env (current-module)'.
  ["redefinition"]: Adjust.

* test-suite/tests/bytevectors.test (c&e): Explicitly compile in the
  current module so that its imports are visible.

14 years agofix bitvectors after the array handle refactoring
Andy Wingo [Thu, 17 Sep 2009 11:52:09 +0000 (13:52 +0200)]
fix bitvectors after the array handle refactoring

* libguile/uniform.h (scm_array_handle_uniform_element_bit_size): New
  public accessor.

* libguile/uniform.c (scm_array_handle_uniform_element_size): Better
  errors in non-byte-aligned arrays.
  (scm_uniform_vector_element_type, scm_uniform_vector_element_size)
  (scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x):
  (scm_uniform_vector_to_list): Don't require byte-aligned access.

* libguile/bytevectors.c (scm_uniform_array_to_bytevector):
* libguile/arrays.c (scm_from_contiguous_typed_array):  Fix for
  uniform arrays whose element size is not a multiple of the byte size.

14 years agofix thinko in api-memory.texi
Andy Wingo [Thu, 17 Sep 2009 10:24:28 +0000 (12:24 +0200)]
fix thinko in api-memory.texi

14 years agoi18n: Remove non-local exists from `u32_locale_casecoll ()'.
Ludovic Courtès [Fri, 18 Sep 2009 10:58:54 +0000 (12:58 +0200)]
i18n: Remove non-local exists from `u32_locale_casecoll ()'.

* libguile/i18n.c (u32_locale_casecoll): Add RESULT argument.  Return
  zero or ERRNO.
  (compare_u32_strings_ci): Adjust accordingly.

14 years agoi18n: Always use locale-dependent string collation.
Ludovic Courtès [Fri, 18 Sep 2009 10:32:09 +0000 (12:32 +0200)]
i18n: Always use locale-dependent string collation.

* libguile/i18n.c (compare_u32_strings, compare_u32_strings_ci): Always
  use locale-dependent string collation.

* test-suite/tests/i18n.test: Recoded in UTF-8.
  (%french-utf8-locale-name): New.
  (under-locale-or-unresolved): New.  Don't catch errors on GNU systems.
  (under-french-locale-or-unresolved): Use it.
  (under-french-utf8-locale-or-unresolved): New.
  ("text collation (French)")["string-locale-ci=? (2 args, wide
  strings)", "string-locale-ci=? (3 args, wide strings)",
  "string-locale-ci<>? (wide strings)", "string-locale-ci<>? (wide and
  narrow strings)", "char-locale-ci<>? (wide)"]: New tests.

14 years agoi18n: Avoid needless heap allocation.
Ludovic Courtès [Fri, 18 Sep 2009 10:21:22 +0000 (12:21 +0200)]
i18n: Avoid needless heap allocation.

* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Allocate buffers on the stack
  rather on the heap.
  (SCM_U32_BUF_FREE): Remove.  Callers updated.

14 years agoi18n: Simplify `RUN_IN_LOCALE_SECTION' (GNU version).
Ludovic Courtès [Fri, 18 Sep 2009 10:15:26 +0000 (12:15 +0200)]
i18n: Simplify `RUN_IN_LOCALE_SECTION' (GNU version).

* libguile/i18n.c (RUN_IN_LOCALE_SECTION)[USE_GNU_LOCALE_API]: Remove
  extraneous uselocale(3) call.

14 years agoAdd the `%host-type' global variable.
Ludovic Courtès [Fri, 18 Sep 2009 09:40:03 +0000 (11:40 +0200)]
Add the `%host-type' global variable.

* configure.ac: Define `HOST_TYPE'.

* libguile/load.c (sys_host_type): New variable.

* doc/ref/api-options.texi (Build Config): Document `%host-type'.

14 years agoAdapt i18n string and char comparison funcs for Unicode
Michael Gran [Thu, 17 Sep 2009 15:14:08 +0000 (08:14 -0700)]
Adapt i18n string and char comparison funcs for Unicode

* libguile/i18n.c (RUN_IN_LOCALE_SECTION) [USE_GNU_LOCALE_API]: new
  macro for this define.  Should work the same as the !USE_GNU_LOCAL_API
  version
  (SCM_STRING_TO_U32_BUF, SCM_U32_BUF_FREE): helper macros
  (compare_u32_strings, compare_u32_strings_ci): new functions that
  compare scheme strings in the presence of the locale
  (u32_locale_casecoll): new helper function for compare_u32_strings_ci
  (compare_strings, compare_strings_ci): removed and replaced by
  compare_u32_strings and compare_u32_strings_ci
  (scm_string_locale_lt, scm_string_locale_gt, scm_string_locale_ci_lt)
  (scm_string_locale_ci_gt, scm_string_locale_ci_eq): modified to
  use new compare_u32_strings and compare_u32_strings_ci comparison
  functions
  (scm_char_locale_lt, scm_char_locale_gt, scm_char_locale_ci_lt)
  (scm_char_locale_ci_gt, scm_char_locale_ci_eq): modified to use
  new compare_u32_strings and compare_u32_strings_ci comparison
  functions

14 years agoRemove deprecation warnings from the build
Neil Jerram [Thu, 17 Sep 2009 00:18:14 +0000 (01:18 +0100)]
Remove deprecation warnings from the build

* module/srfi/srfi-35.scm: Remove explicit use of (ice-9 syncase).

* test-suite/tests/r5rs_pitfall.test: Same again.

* test-suite/tests/syncase.test: Remove "(ice-9 syncase) loads" test;
  syncase is always loaded now.

14 years agoConvenience for running GDB on Guile in Emacs
Neil Jerram [Wed, 16 Sep 2009 23:17:58 +0000 (00:17 +0100)]
Convenience for running GDB on Guile in Emacs

* meta/gdb-uninstalled-guile.in: Add (in a comment) an elisp form that
  can be evaluated to run GDB on Guile in Emacs.

14 years agoFix omission of VM frames from backtrace
Neil Jerram [Wed, 16 Sep 2009 23:14:16 +0000 (00:14 +0100)]
Fix omission of VM frames from backtrace

From the time when a #<program> was a SMOB, really_make_boot_program
in vm.c was still using SCM_SET_SMOB_FLAGS to set the
SCM_F_PROGRAM_IS_BOOT flag - which meant that it was setting flag
1<<32 :-) which obviously was then missed by the SCM_PROGRAM_IS_BOOT
calls in stacks.c.

* libguile/programs.h (SCM_F_PROGRAM_IS_BOOT): Use a less significant
  bit for this flag, now that programs use a tc7 type.

* libguile/vm.c (really_make_boot_program): Don't use
  SCM_SET_SMOB_FLAGS, now that programs aren't SMOBs.

14 years agoFix incorrect stack count warnings
Neil Jerram [Wed, 16 Sep 2009 23:05:06 +0000 (00:05 +0100)]
Fix incorrect stack count warnings

* libguile/stacks.c (stack_depth): Decrement depth count for a
  macro-expansion frame.  (Missing this decrement will cause a "stack
  count incorrect" warning but is actually benign, as it only means
  that scm_make_stack allocates a bit more space for the stack than it
  really needs.)

  (read_frames): Increment count of remaining unused frames, when
  cutting out a macro transformer application frame.  (Missing this
  increment could cause the "stack count incorrect" warning, and could
  make read_frames think it's filled up all the available stack frames
  when there's actually still one frame unused; this wasn't benign,
  because it could cause information to be missing from a stack
  trace.)

14 years agoRemove unhittable else branch for nonexistent type of debug frame
Neil Jerram [Wed, 16 Sep 2009 22:59:15 +0000 (23:59 +0100)]
Remove unhittable else branch for nonexistent type of debug frame

* libguile/stacks.c (stack_depth): Remove unhittable else branch
  apparently catering to a kind of frame that isn't an eval, apply or
  void frame - in fact there are no other kinds of frames.

14 years agoadd the libdir to the ltdl lib search path
Andy Wingo [Wed, 16 Sep 2009 16:10:19 +0000 (18:10 +0200)]
add the libdir to the ltdl lib search path

* libguile/Makefile.am (libpath.h): Fix pkgdatadir, pkglibdir, and
  pkgincludedir entries. Add a new define, SCM_LIB_DIR.

* libguile/dynl.c (sysdep_dynl_init): Add the libdir to the libltdl
  search path. Should fix
  http://thread.gmane.org/gmane.lisp.guile.bugs/4289/focus=4296 -- that
  is, it should allow guile to be invoked from whereever it is
  installed, without munging LTDL_LIBRARY_PATH or the like variables.

  There is a trick though -- during the build, we don't want to be
  looking in the $libdir for loadable modules. So as with
  GUILE_SYSTEM_PATH, we have GUILE_SYSTEM_LTDL_PATH.

* meta/uninstalled-env.in: Set GUILE_SYSTEM_LTDL_PATH to "" when
  building.

14 years agoBump version number for 1.9.3.
Ludovic Courtès [Tue, 15 Sep 2009 21:54:09 +0000 (23:54 +0200)]
Bump version number for 1.9.3.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

14 years agoUse fixnums for int32 when the native word size of greater than 4 bytes.
Ludovic Courtès [Tue, 15 Sep 2009 21:48:01 +0000 (23:48 +0200)]
Use fixnums for int32 when the native word size of greater than 4 bytes.

This should also fix "condition is always true" warnings.

* libguile/vm-i-scheme.c (bv_u32_native_ref, bv_s32_native_ref,
  bv_u32_native_set, bv_s32_native_set): Conditionalize use of
  `BV_FIXABLE_INT_REF' vs. `BV_INT_REF' based on `SIZEOF_VOID_P'.

14 years agoKeep the weak pair API internal.
Ludovic Courtès [Tue, 15 Sep 2009 21:12:39 +0000 (23:12 +0200)]
Keep the weak pair API internal.

* libguile/weaks.h (scm_weak_car_pair, scm_weak_cdr_pair,
  scm_doubly_weak_pair): Make them internal.

14 years agoFix bug #27450 ("Fat mutexes not GC'd until their owner dies").
Ludovic Courtès [Tue, 15 Sep 2009 20:46:55 +0000 (22:46 +0200)]
Fix bug #27450 ("Fat mutexes not GC'd until their owner dies").

* libguile/threads.c (do_thread_exit): Deal with `t->mutexes' being a
  weak list.
  (fat_mutex_lock): Use weak-car pairs when building up `t->mutexes'.

* test-suite/tests/threads.test ("mutex-ownership")["mutex with owner
  not retained (bug #27450)"]: New test.

14 years agoFix the (currently unused) weak pair accessors.
Ludovic Courtès [Tue, 15 Sep 2009 20:33:03 +0000 (22:33 +0200)]
Fix the (currently unused) weak pair accessors.

* libguile/weaks.h (SCM_WEAK_PAIR_WORD): Fixed; changed to return
  `SCM_UNDEFINED' when the word has been nullified.

14 years ago"Document" the `set-module-eval-closure!' weak hash table glitch.
Ludovic Courtès [Tue, 15 Sep 2009 20:31:45 +0000 (22:31 +0200)]
"Document" the `set-module-eval-closure!' weak hash table glitch.

* module/ice-9/boot-9.scm (set-module-eval-closure!): Add link to an
  explanation.

* test-suite/tests/gc.test ("gc")["Unused modules are removed"]:
  Increase the `cleanup' loop.

14 years agoNitpick in `srfi-14.c'.
Ludovic Courtès [Mon, 14 Sep 2009 22:40:44 +0000 (00:40 +0200)]
Nitpick in `srfi-14.c'.

* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): Fix warning about
  the position of BASE_CS.

14 years agoMake the precise stack mark procedure more robust.
Ludovic Courtès [Mon, 14 Sep 2009 22:40:00 +0000 (00:40 +0200)]
Make the precise stack mark procedure more robust.

* libguile/vm.c (vm_stack_mark): Return if VM is NULL.

14 years agoUse GC-robust queues/lists in `threads.c'.
Ludovic Courtès [Mon, 14 Sep 2009 22:39:04 +0000 (00:39 +0200)]
Use GC-robust queues/lists in `threads.c'.

* libguile/threads.c (remqueue, dequeue, on_thread_exit): Initialize the
  "next" link of the item returned/removed.

14 years agoRemove explicit thread/condvar/mutex finalization.
Ludovic Courtès [Mon, 14 Sep 2009 21:37:15 +0000 (23:37 +0200)]
Remove explicit thread/condvar/mutex finalization.

* libguile/threads.c (fat_mutex_free): Remove explicit `scm_gc_free ()'
  call.
  (fat_cond_free, thread_free): Remove.
  (scm_threads_prehistory): Adjust accordingly.

14 years agoUpdate `NEWS'.
Ludovic Courtès [Sun, 13 Sep 2009 22:41:27 +0000 (00:41 +0200)]
Update `NEWS'.

14 years agoMerge `libguile-i18n' into `libguile'.
Ludovic Courtès [Sun, 13 Sep 2009 22:40:03 +0000 (00:40 +0200)]
Merge `libguile-i18n' into `libguile'.

* GUILE-VERSION (LIBGUILE_I18N_MAJOR, LIBGUILE_I18N_INTERFACE_CURRENT,
  LIBGUILE_I18N_INTERFACE_REVISION, LIBGUILE_I18N_INTERFACE_AGE,
  LIBGUILE_I18N_INTERFACE): Remove.

* doc/ref/api-i18n.texi (i18n Introduction): Don't mention
  `libguile-i18n'.

* libguile.h: Include "libguile/i18n.h".

* libguile/Makefile.am (lib_LTLIBRARIES): Remove `libguile-i18n-v*'.
  (libguile_la_SOURCES): Add `i18n.c'.
  (libguile_i18n_v_*_SOURCES, libguile_i18n_v_*_CFLAGS,
  libguile_i18n_v_*_LIBADD, libguile_i18n_v_*_LDFLAGS): Remove.

* libguile/i18n.c (scm_bootstrap_i18n): New function.

* libguile/i18n.h (scm_nl_langinfo, scm_init_i18n): Made internal.
  (scm_bootstrap_i18n): New declaration.

* libguile/init.c (scm_i_init_guile): Invoke `scm_bootstrap_i18n ()'.

* module/ice-9/i18n.scm: Load from `libguile' instead of
  `libguile-i18n-v-0'.

14 years agoSwitch the `encoding*.test' files to LGPLv3+.
Ludovic Courtès [Sun, 13 Sep 2009 14:49:35 +0000 (16:49 +0200)]
Switch the `encoding*.test' files to LGPLv3+.

* test-suite/tests/encoding-escapes.test,
  test-suite/tests/encoding-iso88591.test,
  test-suite/tests/encoding-iso88597.test,
  test-suite/tests/encoding-utf8.test: Switch to LGPLv3+ for the sake of
  consistency.

14 years agoUpdate `scm_without_guile ()' documentation.
Ludovic Courtès [Sun, 13 Sep 2009 14:22:34 +0000 (16:22 +0200)]
Update `scm_without_guile ()' documentation.

* doc/ref/api-scheduling.texi (Blocking): Mention that
  `scm_without_guile ()' & co. aren't needed any longer.

14 years agoRename "boehm-gc.h" to "bdw-gc.h"; add to the distribution.
Ludovic Courtès [Sun, 13 Sep 2009 13:59:31 +0000 (15:59 +0200)]
Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution.

* libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'.

* libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated.  Update to
  LGPLv3+.

14 years agoRemove unused IA64 macro.
Ludovic Courtès [Fri, 11 Sep 2009 09:42:48 +0000 (11:42 +0200)]
Remove unused IA64 macro.

* libguile/threads.c (SCM_MARK_BACKING_STORE): Remove.

14 years agoMore setlocale robustness in regexp tests
Michael Gran [Fri, 11 Sep 2009 04:30:11 +0000 (21:30 -0700)]
More setlocale robustness in regexp tests

* test-suite/tests/regexp.test (mysetlocale, set-latin-1): new functions
  (with-latin1-locale): removed
  (regexp-quote tests): try to print test names in locale but run tests
  in ISO-8859-1.

14 years agoRemove `scm_enter_guile ()' and `scm_leave_guile ()'.
Ludovic Courtès [Thu, 10 Sep 2009 22:03:03 +0000 (00:03 +0200)]
Remove `scm_enter_guile ()' and `scm_leave_guile ()'.

* libguile/threads.c (scm_t_guile_ticket): Remove type.
  (resume, scm_enter_guile, suspend, scm_leave_guile): Remove.
  (scm_i_init_thread_for_guile): Set `t->top' to NULL, which has the
  same effect as calling `scm_enter_guile ()'.
  (scm_leave_guile_cleanup, scm_i_with_guile_and_parent): Remove
  `scm_leave_guile ()' call.

14 years agoAdd `λ' macro as an alternative to `lambda'.
Ludovic Courtès [Thu, 10 Sep 2009 21:58:57 +0000 (23:58 +0200)]
Add `λ' macro as an alternative to `lambda'.

* module/ice-9/boot-9.scm (λ): New macro.

* NEWS: Update.

14 years agoReport missing libunistring at `configure'-time.
Ludovic Courtès [Thu, 10 Sep 2009 17:45:59 +0000 (19:45 +0200)]
Report missing libunistring at `configure'-time.

* configure.ac: Reinstate libunistring check from
  1ee2c72eafaae5f91f4c899bc4b4853af5c16f28.

14 years agoRemove unnecessary uses of `scm_{leave,enter}_guile ()'.
Ludovic Courtès [Wed, 9 Sep 2009 22:21:08 +0000 (00:21 +0200)]
Remove unnecessary uses of `scm_{leave,enter}_guile ()'.

* libguile/threads.c (scm_pthread_cond_wait,
  scm_pthread_cond_timedwait): Remove `scm_{leave,enter}_guile ()'
  calls.

14 years agoLink with `-z relro' when available.
Ludovic Courtès [Thu, 12 Feb 2009 22:20:15 +0000 (23:20 +0100)]
Link with `-z relro' when available.

* acinclude.m4 (GUILE_GNU_LD_RELRO): New macro.

* configure.in: Use `GUILE_GNU_LD_RELRO'.

14 years agoUpdate `NEWS'.
Ludovic Courtès [Wed, 9 Sep 2009 21:01:28 +0000 (23:01 +0200)]
Update `NEWS'.

14 years agoMerge branch 'master' into boehm-demers-weiser-gc
Ludovic Courtès [Wed, 9 Sep 2009 20:32:02 +0000 (22:32 +0200)]
Merge branch 'master' into boehm-demers-weiser-gc

Conflicts:
libguile/gc_os_dep.c

14 years agoAvoid unneeded `scm_dynwind_free ()'.
Ludovic Courtès [Wed, 9 Sep 2009 17:27:42 +0000 (19:27 +0200)]
Avoid unneeded `scm_dynwind_free ()'.

* libguile/array-map.c (indices_gc_hint): New variable.
  (scm_ramapc, scm_array_index_map_x): Avoid `scm_dynwind_free ()' using
  `scm_gc_malloc_pointerless ()'.

14 years agoUpdate doc of `scm_gc_protect_object ()' and SMOB mark/free.
Ludovic Courtès [Wed, 9 Sep 2009 17:14:04 +0000 (19:14 +0200)]
Update doc of `scm_gc_protect_object ()' and SMOB mark/free.

* doc/ref/api-memory.texi (Garbage Collection
  Functions)[scm_gc_protect_object]: Explain that it's equivalent to
  storing in a global variable.

* doc/ref/api-smobs.texi (Smobs)[scm_set_smob_free]: Expand on the
  relationship with `scm_gc_malloc ()'.
  [scm_set_smob_mark]: Explain that it's usually not needed.

14 years agoAvoid prematurely ending regexp test when ISO-8859-1 locale not found
Michael Gran [Wed, 9 Sep 2009 15:11:21 +0000 (08:11 -0700)]
Avoid prematurely ending regexp test when ISO-8859-1 locale not found

* test-suite/tests/regexp.test (with-latin1-locale): new function
  Call tests in context of with-latin1-locale

14 years agoMake scm_i_from_stringn into API for use with libguilereadline
Michael Gran [Wed, 9 Sep 2009 15:07:53 +0000 (08:07 -0700)]
Make scm_i_from_stringn into API for use with libguilereadline

* libguile/strings.c (scm_i_from_stringn): renamed to scm_from_stringn.
  All callers changed.

* libguile/strings.h: change declaration of scm_i_from_stringn to
  scm_from_stringn

* libguile/strports.c (scm_strport_to_string): scm_i_from_stringn ->
  scm_from_stringn

* guile-readline/readline.c (internal_readline): scm_i_from_stringn ->
  scm_from_stringn

14 years agoUpdate documentation of `scm_gc_malloc ()' & co.
Ludovic Courtès [Tue, 8 Sep 2009 22:49:05 +0000 (00:49 +0200)]
Update documentation of `scm_gc_malloc ()' & co.

* doc/ref/api-memory.texi (Memory Blocks): Update description of
  `scm_gc_malloc ()' & co.  Add `scm_gc_malloc_pointerless ()'.

14 years agoUpdate `README'.
Ludovic Courtès [Tue, 8 Sep 2009 22:04:47 +0000 (00:04 +0200)]
Update `README'.

14 years agoFix misleading comments in `gc-benchmarks/run-benchmark.scm'.
Ludovic Courtès [Tue, 8 Sep 2009 21:32:23 +0000 (23:32 +0200)]
Fix misleading comments in `gc-benchmarks/run-benchmark.scm'.

* gc-benchmarks/run-benchmark.scm (pretty-print-result): Fix comments.

14 years agoImprove `gc-benchmarks/run-benchmark.scm'.
Ludovic Courtès [Tue, 8 Sep 2009 20:59:55 +0000 (22:59 +0200)]
Improve `gc-benchmarks/run-benchmark.scm'.

* gc-benchmarks/run-benchmark.scm (pretty-print-result)[ref-heap,
  ref-time]: New variable.
  [distance, score, score-string]: New procedures.
  [print-line]: Use `score-string'.
  (print-raw-result): New procedure.
  (%options)["raw", "load-results"]: New options.
  (%default-options): Add `printer' pair.
  (show-help): Update.
  (main): Add support for `--raw' and `--load-results'.

14 years ago8-bit locale needed for 8-bit regexp tests
Michael Gran [Tue, 8 Sep 2009 01:50:39 +0000 (18:50 -0700)]
8-bit locale needed for 8-bit regexp tests

Since the regex library expects 8-bit clean characters and
an 8-bit locale, tests of 8-bit characters need to occur within
the context of an 8-bit locale.

* test-suite/tests/regexp.test (regexp-quote tests): wrap them in an
  ISO-8859-1 locale

14 years agoFix broken interaction between readline and Unicode
Michael Gran [Tue, 8 Sep 2009 01:42:29 +0000 (18:42 -0700)]
Fix broken interaction between readline and Unicode

This requires separate small fixes.

Readline has internal logic to deal with multi-byte characters, so
it wants bytes, not characters.

scm_c_read gets called by the vm when readline is activated, and it was
truncating multi-byte characters because soft ports didn't have the
UCS-4 capability.

Soft ports need the capability to read UCS-4 characters.  Since soft ports
may have a single byte buffer, full characters need to be stored into the
pushback buffer.

This broke the optimizations in scm_c_read for using an alternate buffer
for single-byte-buffered ports, because the opimization wasn't expecting
anything in the pushback buffer.

* libguile/vports.c (sf_fill_input): store complete chars, not single bytes

* libguile/ports.c (scm_c_read): don't use optimized path for non Latin-1.
  Add debug prints.

* libguile/string.h: make scm_i_from_stringn and scm_i_string_ref public
  so that readline can use them

* guile-readline/readline.c: read bytes, not complete chars, from the
  input port.  Convert output to the output port's locale

14 years agofix compile-time bug compiling (+ "foo" " bar")
Andy Wingo [Sun, 6 Sep 2009 12:13:48 +0000 (14:13 +0200)]
fix compile-time bug compiling (+ "foo" " bar")

* module/language/tree-il/primitives.scm (+, -): Avoid calling exact? on
  non-numeric args.

14 years agoupdate news; ready for 1.9.3
Andy Wingo [Sun, 6 Sep 2009 11:36:32 +0000 (13:36 +0200)]
update news; ready for 1.9.3

* doc/ref/api-control.texi:
* doc/ref/goops.texi: Fix some typos.

* NEWS: Update.

14 years agoupdate NEWS
Andy Wingo [Sun, 6 Sep 2009 10:58:31 +0000 (12:58 +0200)]
update NEWS

* NEWS: Minor text revisions, and fold new NEWS entries into the main
  body too.

14 years agoAvoid string buffer overrun in scm_scan_for_encoding
Michael Gran [Sat, 5 Sep 2009 18:10:07 +0000 (11:10 -0700)]
Avoid string buffer overrun in scm_scan_for_encoding

* libguile/read.c (scm_scan_for_encoding): possible overrun if
  coding declaration is at end of file

14 years agoDoc updates for character encoding of source code files
Michael Gran [Sat, 5 Sep 2009 17:42:15 +0000 (10:42 -0700)]
Doc updates for character encoding of source code files

* NEWS

* doc/ref/scheme-scripts.texi: doc updates for character encoding of
  source code

* doc/ref/api-evaluation.texi: doc updates for character encoding of
  source code

14 years agoDoc updates for Unicode string escapes and port encodings
Michael Gran [Fri, 4 Sep 2009 14:55:05 +0000 (07:55 -0700)]
Doc updates for Unicode string escapes and port encodings

* NEWS: string and port changes

* doc/ref/api-data.texi: string escapes and string-ci

* doc/ref/api-io.texi: port encoding functions

14 years agoRemove locale u8vector functions
Michael Gran [Fri, 4 Sep 2009 14:34:35 +0000 (07:34 -0700)]
Remove locale u8vector functions

Locale u8vector functions deemed harmful.

* libguile/strports.c (scm_strport_to_locale_u8vector)
  (scm_call_with_output_locale_u8vector, scm_open_input_locale_u8vector)
  (scm_get_output_locale_u8vector): removed

* libguile/strports.h: removed declarations for
  scm_strport_to_locale_u8vector,
  scm_call_with_output_u8vector,
  scm_input_locale_u8vector,
  scm_get_output_locale_u8vector

* test-suite/tests/encoding-iso88591.test: display tests removed

* test-suite/tests/encoding-iso88597.test: display tests removed

14 years agoInitialize string ports with UTF-8 encoding
Michael Gran [Fri, 4 Sep 2009 14:30:13 +0000 (07:30 -0700)]
Initialize string ports with UTF-8 encoding

String ports should be able to accept any string characters, regardless
of the current locale.  Setting it to UTF-8 achieves that.

* libguile/strports.c (scm_i_mkstrport): set port's locale to UTF-8
  (scm_mkstrport): convert input string to UTF-8

14 years agowrite-char should handle UCS-4 characters
Michael Gran [Fri, 4 Sep 2009 14:27:14 +0000 (07:27 -0700)]
write-char should handle UCS-4 characters

* libguile/print.c (scm_write_char): call UCS-4 printing routine, instead
  of 8-bit primitive

14 years agoMake test-case compilation with -DSCM_DEBUG=1 work.
Ken Raeburn [Thu, 3 Sep 2009 20:59:11 +0000 (16:59 -0400)]
Make test-case compilation with -DSCM_DEBUG=1 work.

* gc.h (scm_i_expensive_validation_check): Declare SCM_API.

14 years agoDoc updates for srfi-14 character sets
Michael Gran [Thu, 3 Sep 2009 16:03:53 +0000 (09:03 -0700)]
Doc updates for srfi-14 character sets

* NEWS: updates for srfi-14 character sets

* doc/ref/api-data.texi: update char-set section and some spellchecking

14 years agoUpdate docs and docstrings for Unicode characters
Michael Gran [Thu, 3 Sep 2009 15:48:23 +0000 (08:48 -0700)]
Update docs and docstrings for Unicode characters

* doc/ref/api-data.texi: more info about characters and codepoints

* libguile/chars.c: replace 'code point' with 'Unicode code point' in
  docstrings

14 years agoAdd char-set debugging function
Michael Gran [Thu, 3 Sep 2009 15:29:45 +0000 (08:29 -0700)]
Add char-set debugging function

* libguile/srfi-14.c (scm_sys_char_set_dump): new function

* libguile/srfi-14.h: declaration of scm_sys_char_set_dump

14 years agoDistinguish between all codepoints and designated codepoints in char-sets
Michael Gran [Thu, 3 Sep 2009 15:23:24 +0000 (08:23 -0700)]
Distinguish between all codepoints and designated codepoints in char-sets

* libguile/unidata_to_charset.pl (designated): renamed from full

* libguile/srfi-14.c (scm_char_set_designated): new char-set

* libguile/srfi-14.i.c (cs_designated): renamed from cs_full

14 years agoModify read and print of combining characters
Michael Gran [Thu, 3 Sep 2009 14:47:26 +0000 (07:47 -0700)]
Modify read and print of combining characters

Since combining characters, such as accents, modify the appearance of the
previous letter, it looks awkward in its character literal form (#\name)
since it modified the backslash.  This instead prints the combining
character on a small circle.

* libguile/chars.h (SCM_CODEPOINT_DOTTED_CIRCLE): new #define

* libguile/print.c (iprint1): print combining characters on dotted circles

* libguile/read.c (scm_read_character): parse the combination of combining
  characters and dotted circles

14 years agoFix invalid syntax in `dynamic-input-large.sch' (gc-benchmarks).
Ludovic Courtès [Wed, 2 Sep 2009 22:59:57 +0000 (00:59 +0200)]
Fix invalid syntax in `dynamic-input-large.sch' (gc-benchmarks).

* gc-benchmarks/larceny/dynamic-input-large.sch: Remove invalid "\;"
  escape.

14 years agoAdd test case for `scm_take_u8vector ()'.
Ludovic Courtès [Wed, 2 Sep 2009 22:57:24 +0000 (00:57 +0200)]
Add test case for `scm_take_u8vector ()'.

This is a followup to commit d7e7a02a6251c8ed4f76933d9d30baeee3f599c0
("Fix leaky behavior of `scm_take_TAGvector ()'.") and a reminder that
the uniform vector implementation can't do away with the cell->buffer
indirection.

* test-suite/standalone/Makefile.am (test_scm_take_u8vector_SOURCES,
  test_scm_take_u8vector_CFLAGS, test_scm_take_u8vector_LDADD): New.
  (check_PROGRAMS, TESTS): Add `test-scm-take-u8vector'.

* test-suite/standalone/test-scm-take-u8vector.c: New file.

14 years agoRemove always-true range checks in scm_i_ucs_range_to_char_set
Michael Gran [Wed, 2 Sep 2009 13:45:05 +0000 (06:45 -0700)]
Remove always-true range checks in scm_i_ucs_range_to_char_set

* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): limits are always
  non-negative due to the type of the variable

14 years agoMore srfi-14 char-set tests
Michael Gran [Wed, 2 Sep 2009 13:26:50 +0000 (06:26 -0700)]
More srfi-14 char-set tests

* test-suite/tests/srfi-14.test: many new tests

14 years agoUnreachable code in charset set operator
Michael Gran [Wed, 2 Sep 2009 13:21:40 +0000 (06:21 -0700)]
Unreachable code in charset set operator

* libguile/srfi-14.c (scm_i_charset_set): remove unreachable code
  in scm_i_charset_set

14 years agoOptimize charset union operator
Michael Gran [Wed, 2 Sep 2009 13:20:45 +0000 (06:20 -0700)]
Optimize charset union operator

* libguile/srfi-14.c (charsets_union): call scm_i_charset_set_range
  instead of setting characters one-by-one.

14 years agoThe charset complement operator should not include surrogates
Michael Gran [Wed, 2 Sep 2009 13:19:21 +0000 (06:19 -0700)]
The charset complement operator should not include surrogates

* libguile/srfi-14.c (charsets_complement): skip over surrogates
  when making a charset complement

14 years agochar-set-filter! does not properly iterate over the charset
Michael Gran [Wed, 2 Sep 2009 13:16:35 +0000 (06:16 -0700)]
char-set-filter! does not properly iterate over the charset

* libguile/srfi-14.c (scm_char_set_filter_x): iterate over
  codepoints

14 years agoucs-range->char-set should not store surrogates and has off-by-one error
Michael Gran [Wed, 2 Sep 2009 13:14:49 +0000 (06:14 -0700)]
ucs-range->char-set should not store surrogates and has off-by-one error

* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): new function that
  contains the functionality of ucs_range_to_char_set, fixes
  off-by-one, and doesn't store surroges
  (scm_ucs_range_to_char_set, scm_ucs_range_to_char_set_x): call
  scm_i_ucs_range_to_char_set
  (scm_i_charset_set_range): new helper function

14 years agochar-set-any improperly unpacks charset data
Michael Gran [Wed, 2 Sep 2009 13:03:28 +0000 (06:03 -0700)]
char-set-any improperly unpacks charset data

* libguile/srfi-14.c (scm_char_set_any): unpack the charset correctly

14 years agochar-set-xor! should modify the input parameter
Michael Gran [Wed, 2 Sep 2009 13:02:14 +0000 (06:02 -0700)]
char-set-xor! should modify the input parameter

char-set-xor! was not modifying its input parameter.  It isn't
technically required to do so by the spec, but, the other similar
functions do it.

* libguile/srfi-14.c (scm_char_set_xor_x): modify the input parameter