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.
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.
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.)
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.
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.
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.
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'.
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.
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.
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.
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.
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.
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.
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.
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.
Ludovic Courtès [Sun, 13 Sep 2009 22:41:27 +0000 (00:41 +0200)]
Update `NEWS'.
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'.
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.
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.
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+.
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.
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.
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.
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.
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.
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.
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'.
Ludovic Courtès [Wed, 9 Sep 2009 21:01:28 +0000 (23:01 +0200)]
Update `NEWS'.
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
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 ()'.
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.
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
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
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 ()'.
Ludovic Courtès [Tue, 8 Sep 2009 22:04:47 +0000 (00:04 +0200)]
Update `README'.
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.
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'.
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
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
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.
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.
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.
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
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
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
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
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
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
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.
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
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
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
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
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
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.
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.
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
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
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
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.
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
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
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
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
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
Ludovic Courtès [Tue, 1 Sep 2009 21:53:58 +0000 (23:53 +0200)]
Fix leaky behavior of `scm_take_TAGvector ()'.
* libguile/srfi-4.c (free_user_data): New function.
* libguile/srfi-4.i.c (scm_take_TAGvector): Register `free_user_data ()'
as a finalizer for DATA.
* libguile/objcodes.c (scm_objcode_to_bytecode): Allocate with
`scm_malloc ()' since the memory taken by `scm_take_u8vector ()' will
eventually be free(3)d.
* libguile/vm.c (really_make_boot_program): Likewise.
Andy Wingo [Tue, 1 Sep 2009 16:07:29 +0000 (18:07 +0200)]
fix nontail loops within loops
* module/language/tree-il/compile-glil.scm (flatten): Fix compilation of
loops within loops in non-tail positions. Will add a test case soon,
but one way to reproduce it was with the following function:
(define (test)
(let lp ()
(pk 'zero)
(let ((fk (lambda ()
(let ((fk2 (lambda () (pk 'two))))
(let ((fk3 (lambda () (if #t (pk 'three) (fk2)))))
(if #t
(fk3)
(fk2)))))))
(pk 'one)
(fk))
(lp)))
One would expect to see a sequence of "zero one three", but in fact zero
only showed once.
This should fix simplex as well.
Ludovic Courtès [Tue, 1 Sep 2009 00:02:43 +0000 (02:02 +0200)]
Remove the distinction between inline/outline storage for stringbufs.
* libguile/strings.c (STRINGBUF_HEADER_SIZE, STRINGBUF_HEADER_BYTES):
New macros.
(STRINGBUF_F_INLINE, STRINGBUF_INLINE, STRINGBUF_OUTLINE_CHARS,
STRINGBUF_OUTLINE_LENGTH, STRINGBUF_INLINE_CHARS,
STRINGBUF_INLINE_LENGTH, STRINGBUF_MAX_INLINE_LEN): Remove.
(STRINGBUF_CHARS, STRINGBUF_WIDE_CHARS): Adjust to return a fixed
location.
(STRINGBUF_LENGTH): Get the length from word 1.
(make_stringbuf, make_wide_stringbuf): Adjust to use a contiguous
memory region.
(wide_stringbuf): Renamed from `widen_stringbuf'. Adjust similarly.
Return the new stringbuf. Callers updated.
(narrow_stringbuf): Likewise.
(scm_sys_string_dump, scm_sys_symbol_dump): Remove `stringbuf-inline'
pair.
* test-suite/tests/strings.test ("string internals")["null strings are
inlined", "short Latin-1 encoded strings are inlined", "long Latin-1
encoded strings are not inlined", "short UCS-4 encoded strings are not
inlined", "long UCS-4 encoded strings are not inlined"]: Remove.
* test-suite/tests/symbols.test ("symbol internals")["null symbols are
inlined", "short Latin-1 encoded symbols are inlined", "long Latin-1
encoded symbols are not inlined", "short UCS-4 encoded symbols are not
inlined", "long UCS-4 encoded symbols are not inlined"]: Remove.
Ludovic Courtès [Mon, 31 Aug 2009 22:38:40 +0000 (00:38 +0200)]
Fix leaky handling of `scm_take_locale_{symbol,string} ()'.
* libguile/strings.c (scm_i_take_stringbufn, scm_i_c_take_symbol):
Remove.
(scm_take_locale_stringn): Rewrite in terms of `scm_from_locale_stringn ()'.
* libguile/strings.h (scm_i_c_take_symbol, scm_i_take_stringbufn):
Remove declarations.
Michael Gran [Sun, 30 Aug 2009 22:58:32 +0000 (15:58 -0700)]
Update docs for Unicode characters
* NEWS: add note about Unicode characters
* doc/ref/api-data.texi: update Characters subsection
* libguile/chars.c: update docstrings to match manual
Michael Gran [Sun, 30 Aug 2009 23:51:30 +0000 (16:51 -0700)]
Tests for display and writing of characters
* test-suite/tests/encoding-iso88591.test: tests for writing and display
of characters
* test-suite/tests/encoding-iso88597.test: tests for writing and display
of characters
* test-suite/tests/encoding-utf8.test: tests for writing and display
of characters
Michael Gran [Sun, 30 Aug 2009 23:48:03 +0000 (16:48 -0700)]
Fix escape sequence normalization for wide strings
* libguile/strings.c (scm_to_stringn): convert unistring escapes to
guile escapes for both wide and narrow strings
Michael Gran [Sun, 30 Aug 2009 22:41:56 +0000 (15:41 -0700)]
Fix encoding errors with strings returned by string ports
String ports, being 8-bit, store strings using the character encoding
of the port. This fixes a bug where the default character encoding, and
not the port's encoding, was being used to convert the string port data
back to a string.
* libguile/strports.c: extra comments
(scm_strport_to_string): use port's encoding when converting port data
to a string
* libguile/strings.c (scm_i_from_stringn): renamed from scm_from_stringn
and made internal. All callers changed.
(scm_from_stringn): renamed to scm_i_from_stringn.
* libguile/strings.h: declaration for scm_i_from_stringn
Ludovic Courtès [Sun, 30 Aug 2009 23:28:09 +0000 (01:28 +0200)]
Fix `benchmark-guile'.
* benchmark-guile.in (guile): Use `meta/guile', not `pre-inst-guile'.
Ludovic Courtès [Sun, 30 Aug 2009 23:07:30 +0000 (01:07 +0200)]
Remove the distinction between inline/outline storage for bytevectors.
* libguile/bytevectors.c (SCM_BYTEVECTOR_INLINE_THRESHOLD,
SCM_BYTEVECTOR_INLINEABLE_SIZE_P, SCM_BYTEVECTOR_SET_CONTENTS,
SCM_BYTEVECTOR_SET_INLINE): Remove.
(SCM_BYTEVECTOR_HEADER_BYTES): New macro.
(SCM_BYTEVECTOR_SET_ELEMENT_TYPE): Adjust to new flag layout.
(make_bytevector): Remove content inlining machinery; use
`scm_gc_malloc_pointerless ()' in all cases; special-case zero-sized
vu8 buffers.
(make_bytevector_from_buffer): Simplified.
(scm_c_shrink_bytevector): New, formerly `scm_i_shrink_bytevector ()'.
Remove buffer inlining machinery.
(scm_bootstrap_bytevectors): Use `make_bytevector ()' for
SCM_NULL_BYTEVECTOR.
* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): New macro.
(SCM_BYTEVECTOR_CONTENTS): Adjust to new layout.
(SCM_SET_BYTEVECTOR_FLAGS): Properly cast F.
(SCM_F_BYTEVECTOR_INLINE, SCM_BYTEVECTOR_INLINE_P): Remove.
(SCM_BYTEVECTOR_ELEMENT_TYPE): Adjust.
(scm_c_shrink_bytevector): Remove macro, make a C function
declaration.
Ludovic Courtès [Sun, 30 Aug 2009 18:12:09 +0000 (20:12 +0200)]
Use a TC7 tag instead of a SMOB for bytevectors.
* libguile/bytevectors.c (scm_tc16_bytevector): Remove.
(SCM_BYTEVECTOR_SET_LENGTH, SCM_BYTEVECTOR_SET_CONTENTS,
SCM_BYTEVECTOR_SET_INLINE, SCM_BYTEVECTOR_SET_ELEMENT_TYPE,
make_bytevector_from_buffer, scm_is_bytevector,
scm_bootstrap_bytevectors): Adjust to the SMOB->tc7 change.
(scm_i_print_bytevector): New, formerly `print_bytevector ()'.
(bytevector_equal_p): Remove.
* libguile/bytevectors.h (SCM_BYTEVECTOR_LENGTH,
SCM_BYTEVECTOR_CONTENTS, SCM_BYTEVECTOR_P): Adjust to SMOB->tc7
change.
(SCM_BYTEVECTOR_FLAGS, SCM_SET_BYTEVECTOR_FLAGS): New macros.
(scm_tc16_bytevector): Remove declaration.
(scm_i_print_bytevector): New declaration.
* libguile/eq.c (scm_equal_p): Handle `scm_tc7_bytevector'.
* libguile/evalext.c (scm_self_evaluating_p): Likewise.
* libguile/print.c (iprin1): Likewise.
* libguile/tags.h (scm_tc7_bytevector): New.
(scm_tc7_unused_8): Remove.
* libguile/validate.h (SCM_VALIDATE_BYTEVECTOR): Adjust.
* test-suite/tests/bytevectors.test ("Datum
Syntax")["self-evaluating?"]: New test.
Neil Jerram [Sun, 30 Aug 2009 10:03:34 +0000 (11:03 +0100)]
Export readline history functions
* guile-readline/ice-9/readline.scm: Export history functions.
Michael Gran [Sat, 29 Aug 2009 14:14:49 +0000 (07:14 -0700)]
Range check octal-escaped characters
* libguile/read.c (scm_read_character): range check octal escapes
Michael Gran [Sat, 29 Aug 2009 14:11:31 +0000 (07:11 -0700)]
More tests for chars.test
Testing out-of-range octals, bad charnames, and write format
* test-suite/tests/chars.test
Michael Gran [Sat, 29 Aug 2009 06:48:36 +0000 (23:48 -0700)]
More tests for chars.test
* test-suite/tests/chars.test: more tests
Michael Gran [Sat, 29 Aug 2009 06:47:42 +0000 (23:47 -0700)]
Surrogate characters shouldn't be in charsets
* libguile/srfi-14.c (charsets_complement): use surrogate #defines instead
of hardcoded numbers
* libguile/srfi-14.i.c (cs_full_ranges): remove surrogates from full
charset
* libguile/unidata_to_charset.pl (full): test for surrogates
Michael Gran [Sat, 29 Aug 2009 06:44:41 +0000 (23:44 -0700)]
Better range check for codepoints
* libguile/chars.h (SCM_IS_UNICODE_CHAR): check for negative codepoints
Michael Gran [Sat, 29 Aug 2009 04:19:05 +0000 (21:19 -0700)]
Cast the input to isalpha et al to integer
* libguile/gc_os_dep.c (GC_linux_stack_base) [LINUX_STACKBOTTOM]: cast
input of ctype functions to int
* libguile/inet_aton.c (inet_aton): cast input of ctype functions to int
* libguile/read.c (scm_scan_for_encoding): cast input of isalnum to int
* libguile/win32-socket.c (scm_i_socket_uncomment): cast input of isspace
to int
Ludovic Courtès [Fri, 28 Aug 2009 19:08:07 +0000 (21:08 +0200)]
Add `BDW_GC_CFLAGS' to the `.pc' files.
This is needed because <gc/gc.h> is included in public headers (via
<libguile/boehm-gc.h>.
* meta/guile-2.0-uninstalled.pc.in (Cflags): Add `@BDW_GC_CFLAGS'.
* meta/guile-2.0.pc.in (Cflags): Likewise.
Ludovic Courtès [Fri, 28 Aug 2009 18:25:49 +0000 (20:25 +0200)]
Remove deprecated variables/macros from the GC headers.
* libguile/deprecated.c (scm_mtrigger, scm_mallocated,
scm_max_segment_size): New global variables, from gc.c.
(scm_map_free_list,
scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New stubs.
* libguile/deprecated.h (scm_mallocated, scm_mtrigger,
scm_max_segment_size): New declarations.
(scm_map_free_list,
scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New
declarations.
* libguile/gc-malloc.c (scm_i_minyield_malloc): Remove.
(scm_gc_init_malloc): Remove references to `scm_i_minyield_malloc' and
`scm_mtrigger'.
* libguile/gc.c (scm_mtrigger, scm_mallocated): Remove.
(scm_init_storage): Remove reference to `SCM_HEAP_SEG_SIZE'.
* libguile/gc.h (scm_max_segment_size, SCM_SET_FREELIST_LOC,
SCM_FREELIST_LOC, scm_i_master_freelist, scm_i_master_freelist2,
scm_mallocated, scm_mtrigger): Remove.
(scm_map_free_list,
scm_gc_set_debug_check_freelist_x)[SCM_ENABLE_DEPRECATED &&
GUILE_DEBUG_FREELIST]: Remove.
* libguile/private-gc.h (SCM_DEFAULT_INIT_HEAP_SIZE_1,
SCM_DEFAULT_MIN_YIELD_1, SCM_DEFAULT_MIN_YIELD_2,
DEFAULT_SWEEP_AMOUNT, SCM_DEFAULT_MAX_SEGMENT_SIZE,
SCM_MIN_HEAP_SEG_SIZE, SCM_HEAP_SEG_SIZE,
SCM_GC_CARD_BVEC_SIZE_IN_LONGS, SCM_GC_IN_CARD_HEADERP): Remove.
(scm_getenv_int): Made internal.
(scm_i_marking, scm_mark_all, scm_i_deprecated_memory_return,
scm_i_find_heap_calls, scm_gc_init_malloc, scm_gc_init_freelist,
scm_gc_init_segments, scm_gc_init_mark): Remove declarations.
* libguile/gc-segment-table.c: Remove, finally.
Ludovic Courtès [Fri, 28 Aug 2009 17:01:19 +0000 (19:01 +0200)]
Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
libguile/Makefile.am
libguile/bytevectors.c
libguile/gc-card.c
libguile/gc-mark.c
libguile/programs.c
libguile/srcprop.c
libguile/srfi-14.c
libguile/symbols.c
libguile/threads.c
libguile/unif.c
libguile/vm.c
Andy Wingo [Fri, 28 Aug 2009 15:12:15 +0000 (17:12 +0200)]
fix case in which compiled path had stale .go, but fallback had fresh .go
* libguile/load.c (scm_primitive_load_path): If the compiled path was
out of date, but the fallback path was current, we correctly detected
that case, but loaded the wrong file. So here fix the typo.
Michael Gran [Fri, 28 Aug 2009 13:27:00 +0000 (06:27 -0700)]
Don't presume existence or success of setlocale in test-suite
* test-suite/lib.scm (with-locale, with-locale*): new test functions
* test-suite/tests/encoding-escapes: don't fail if en_US.utf8 doesn't exist
* test-suite/tests/encoding-iso88591.test: set and restore locale, if
possible
* test-suite/tests/encoding-iso88597.test: set and restore locale, if
possible
* test-suite/tests/encoding-utf8.test: set and restore locale, if possible
* test-suite/tests/srfi-14.test: don't need to setlocale to Latin-1 to
test Latin-1 since string conversion is handled at read/compile time.
Set and restore locale, if possible.
Michael Gran [Fri, 28 Aug 2009 03:42:36 +0000 (20:42 -0700)]
scm_getc improperly handles Latin-1 characters
Upper-plane Latin-1 characters should be converted to codepoints.
* libguile/ports.c (scm_getc): improper conversion of char to scm_t_wchar
Michael Gran [Fri, 28 Aug 2009 01:52:53 +0000 (18:52 -0700)]
Fix FUNC_NAME definitions and #endif in srfi-14.[ch]
* libguile/srfi-14.c: whitespace and FUNC_NAME fixes
* libguile/srfi-14.h: #endif comment
Michael Gran [Fri, 28 Aug 2009 01:23:46 +0000 (18:23 -0700)]
Script to generate srfi-14 charsets from UnicodeData.txt
This script was used to generate srfi-14.i.c from the UnicodeData.txt
file supplied by ftp://www.unicode.org/Public/UNIDATA/
* libguile/unidata_to_charset.pl
Neil Jerram [Thu, 27 Aug 2009 23:29:04 +0000 (00:29 +0100)]
Fix GDS utility client startup
* emacs/gds-scheme.el (gds-start-utility-guile): Use buffer-local
variable gds-client instead of client, as client is actually unbound
when the process-filter lambda runs. (i.e. This isn't Scheme code!)
Ludovic Courtès [Thu, 27 Aug 2009 23:16:49 +0000 (01:16 +0200)]
Add missing `FUNC_NAME' definition.
* libguile/load.c (scm_sys_warn_autocompilation_enabled): Define
`FUNC_NAME'.
Neil Jerram [Thu, 27 Aug 2009 21:52:20 +0000 (22:52 +0100)]
Merge branch 'ossau-gds-dev'
Conflicts:
THANKS
Neil Jerram [Fri, 17 Jul 2009 07:00:42 +0000 (08:00 +0100)]
Fix doc of let*-values
Thanks to Judy Hawkins for reporting this.
* doc/ref/api-modules.texi (Included Guile Modules): Change
`let-values*' to `let*-values'.
Neil Jerram [Thu, 27 Aug 2009 21:22:34 +0000 (22:22 +0100)]
Make GDS resilient to autocompilation comments
* emacs/gds-scheme.el (gds-start-utility-guile): Make the extraction
of client number more robust; in particular when the client emits
comments (about auto compilation) before the number.
Neil Jerram [Thu, 27 Aug 2009 21:21:20 +0000 (22:21 +0100)]
Incorporate ice-9-debugger-extensions properly
i.e. put the extensions where they need to be, and delete
ice-9-debugger-extensions.scm.
* doc/ref/api-debug.texi (Single Stepping through a Procedure's Code):
Change mentions of (ice-9 debugging ice-9-debugger-extensions)
module to whatever is appropriate now (or just remove them).
* module/Makefile.am (NOCOMP_SOURCES): Remove
ice-9-debugger-extensions.scm.
* module/ice-9/debugger.scm (debug-trap): Move here from
ice-9-debugger-extensions.scm.
* module/ice-9/debugger/command-loop.scm ("continue", "finish",
"step", "next"): Move here from ice-9-debugger-extensions.scm.
* module/ice-9/debugger/commands.scm (assert-continuable, continue,
finish, step, next): Move here from ice-9-debugger-extensions.scm.
* module/ice-9/debugging/breakpoints.scm: Don't use
ice-9-debugger-extensions module.
* module/ice-9/debugging/ice-9-debugger-extensions.scm: Removed.
* module/ice-9/debugging/trace.scm, module/ice-9/debugging/traps.scm:
Remove more old version code.
* module/ice-9/debugging/traps.scm (guile-trap-features): Hardcoded as
'(tweaking).
Neil Jerram [Thu, 27 Aug 2009 20:50:46 +0000 (21:50 +0100)]
Remove superfluous ice-9-debugger-extensions code for old Guile versions
* module/ice-9/debugging/ice-9-debugger-extensions.scm: Remove all
code checking for version < 1.7, and move code for versions >= 1.7
up to top level. Comment out dummy mutex definitions for now, as
I'm not sure how to rewrite them correctly for psyntax.
Michael Gran [Thu, 27 Aug 2009 16:13:22 +0000 (09:13 -0700)]
Default srfi-14 character set information
* libguile/srfi-14.i.c: structures containing the default srfi-14
sets
Michael Gran [Thu, 27 Aug 2009 14:35:39 +0000 (07:35 -0700)]
Always cast input to toupper as int
* libguile/read.c (scm_scan_for_encoding): add cast to int