Andy Wingo [Thu, 21 Jul 2011 07:42:20 +0000 (09:42 +0200)]
open-socket-for-url returns port in latin1 encoding
* module/web/client.scm (open-socket-for-uri): Set port encoding to
latin1, to see if this fixes Nalin Garut's problems.
Andy Wingo [Mon, 18 Jul 2011 08:37:46 +0000 (10:37 +0200)]
fix web-request.test
* test-suite/tests/web-request.test ("example-1"): Fix expected format
of `host' header.
Andy Wingo [Fri, 15 Jul 2011 11:08:45 +0000 (13:08 +0200)]
ensure presence of Host header in HTTP/1.1 requests
* module/web/request.scm (build-request): Make sure that HTTP/1.1
requests have the Host header set, per RFC 2616 section 9.
* test-suite/tests/web-request.test ("example-1"): Add test.
Andy Wingo [Fri, 15 Jul 2011 10:49:46 +0000 (12:49 +0200)]
add (web client)
* module/web/client.scm: New module, a simple synchronous web client.
* module/Makefile.am (WEB_SOURCES): Add to the build.
Ludovic Courtès [Tue, 12 Jul 2011 21:57:57 +0000 (23:57 +0200)]
Fix `open' mode bits on GNU/Hurd.
* libguile/filesys.c (scm_open): Fix check for read-write flags for
systems such as GNU/Hurd, where O_RDWR == (O_WRONLY | O_RDONLY)
and O_RDONLY != 0.
Ludovic Courtès [Tue, 12 Jul 2011 21:08:42 +0000 (23:08 +0200)]
Define `O_NOTRANS' on GNU/Hurd.
* libguile/filesys.c (scm_init_filesys): Define `O_NOTRANS' when
available.
Ludovic Courtès [Tue, 12 Jul 2011 07:26:32 +0000 (09:26 +0200)]
Disable TLS on NetBSD up to 5.x included.
* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Disable TLS on
`x86_64-unknown-netbsd5.1' too.
Ludovic Courtès [Tue, 12 Jul 2011 07:24:14 +0000 (09:24 +0200)]
Add document describing the release process.
* doc/release.org: New file.
Andy Wingo [Thu, 7 Jul 2011 10:45:30 +0000 (12:45 +0200)]
fix CPL of <extended-generic-with-setter> and <extended-accessor>
* libguile/goops.c (fix_cpl): Fix bug in placement of debug assertion.
(create_standard_classes): Put <extended-generic> before
<generic-with-setter> in <extended-generic-with-setter>'s direct
supers, so that the slot allocation is a superset of
<generic-with-setter>, which results in the `setter' being allocated
in the same place.
Likewise fix <extended-accessor> to place <extended-generic> before
<generic-with-setter>, not just <generic>.
Andy Wingo [Thu, 7 Jul 2011 10:21:48 +0000 (12:21 +0200)]
fix invocation of duplicate handlers for merge-generics
* libguile/modules.c (resolve_duplicate_binding): Fix unbound -> #f
conversion for the imported bindings. Pass the existing entry in the
import obarray as the resolved var (7th arg), and properly pass #f as
the value (8th arg) if there is no such binding. Fixes
merge-generics; before, the <boolean> type test (indicating no
previous value) was not being triggered. This bug has been present
since 2007 at least, though it was not in 1.8.
* test-suite/tests/modules.test ("duplicate bindings"): Add a test that
the var and val are both #f. These types are used by GOOPS.
Andy Wingo [Thu, 7 Jul 2011 10:17:08 +0000 (12:17 +0200)]
goops.scm cleanups
* module/oop/goops.scm (make-generic, make-extended-generic):
(ensure-generic, make-accessor, ensure-accessor): Use optional
arguments for #:name. `make-extended-generic' also accepts empty
extension lists.
Andy Wingo [Wed, 6 Jul 2011 12:01:03 +0000 (14:01 +0200)]
more precision for ,time
* module/system/repl/command.scm (time): Use the high-precision timers
instead of stime(2). Changes the output format of `,time' too;
perhaps there is a better way.
Ludovic Courtès [Wed, 6 Jul 2011 16:21:07 +0000 (18:21 +0200)]
doc: Fix `merge-generics' example.
* doc/ref/goops.texi (Merging Generics): Change (my-module) example to
use (oop goops) and use the right syntax for #:duplicates. Reported
by David Pirotte <david@altosw.be>.
Ludovic Courtès [Wed, 6 Jul 2011 14:01:22 +0000 (16:01 +0200)]
configure: Build a `tar.xz' in addition to `tar.gz'.
* configure.ac: Explicitly require Automake 1.11. Add Automake option
`dist-xz'.
Ludovic Courtès [Mon, 4 Jul 2011 21:56:16 +0000 (23:56 +0200)]
VM: Keep jump table address in a register.
* libguile/vm-engine.c (VM_NAME)[HAVE_LABELS_AS_VALUES]: Rename
`jump_table' to `jump_table_pointer'. Add `jump_table' as a local
variable, initialize it.
* libguile/vm-engine.h (JT_REG): New macro.
Ludovic Courtès [Fri, 1 Jul 2011 21:54:10 +0000 (23:54 +0200)]
Bump version number for 2.0.2.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
(LIBGUILE_INTERFACE_CURRENT): Increment to account for new C function
`scm_peek_byte_or_eof'.
(LIBGUILE_INTERFACE_AGE): Increment.
Ludovic Courtès [Fri, 1 Jul 2011 20:49:50 +0000 (22:49 +0200)]
Update `NEWS'.
Ludovic Courtès [Fri, 1 Jul 2011 20:43:01 +0000 (22:43 +0200)]
Revert "Fix lock ordering in `fat_mutex_lock' to match that of `do_thread_exit'."
This reverts commit
ccb80964cd7cd112e300c34d32f67125a6d6da9a, which
introduced a race condition, with a small window during which a mutex
could be held by a thread without being part of its `mutexes' list,
thereby violating the invariant tested at line 667.
Ludovic Courtès [Fri, 1 Jul 2011 20:34:29 +0000 (22:34 +0200)]
Update Gnulib to
v0.0-5874-g7170ee0.
Ludovic Courtès [Fri, 1 Jul 2011 17:10:18 +0000 (19:10 +0200)]
Type-check the OWNER argument of `lock-mutex'.
* libguile/threads.c (scm_lock_mutex_timed): Type-check OWNER.
Ludovic Courtès [Fri, 1 Jul 2011 17:09:29 +0000 (19:09 +0200)]
Add type and range checks to the complex generalized vector accessors.
* libguile/bytevectors.c (COMPLEX_ACCESSOR_PROLOGUE, COMPLEX_NATIVE_REF,
COMPLEX_NATIVE_SET): New macros.
(bytevector_ref_c32, bytevector_ref_c64): Defined in terms of
`COMPLEX_NATIVE_REF'.
(bytevector_set_c32, bytevector_set_c64): Defined in terms of
`COMPLEX_NATIVE_SET'.
(bytevector_ref_fns): Make `static'.
* test-suite/tests/srfi-4.test ("c32 vectors")["generalized-vector-ref",
"generalized-vector-set!", "generalized-vector-ref, out-of-range",
"generalized-vector-set!, out-of-range"]: New tests.
("c64 vectors")["generalized-vector-ref", "generalized-vector-set!",
"generalized-vector-ref, out-of-range",
"generalized-vector-set!, out-of-range"]: New tests.
Ludovic Courtès [Fri, 1 Jul 2011 14:21:21 +0000 (16:21 +0200)]
Fix unaligned accesses for bytevectors of complex numbers.
* libguile/bytevectors.c (bytevector_ref_c32, bytevector_ref_c64,
bytevector_set_c32, bytevector_set_c64): Use `memcpy' to avoid
unaligned accesses. This fixes SIGBUS on SPARC and possibly other
alignment-sensitive platforms.
Ludovic Courtès [Fri, 1 Jul 2011 13:29:51 +0000 (15:29 +0200)]
i18n: Don't use `!=' to compare SCMs.
* libguile/i18n.c (install_locale)[!USE_GNU_LOCALE_API]: Use
`SCM_UNBNDP' instead of `!='.
Andy Wingo [Fri, 1 Jul 2011 10:20:52 +0000 (12:20 +0200)]
fix '(a #{.} b)
* libguile/read.c (scm_read_sexp): Don't confuse `#{.}#' with `.' for
the purpose of reading dotted pairs. Thanks to CRLF0710 for the
report.
* test-suite/tests/reader.test ("#{}#"): Add test.
Ludovic Courtès [Thu, 30 Jun 2011 20:58:07 +0000 (22:58 +0200)]
Fix `on_thread_exit' for canceled threads.
* libguile/threads.c (on_thread_exit): Clear `t->guile_mode' upon
entry. This fixes a bug whereby `t->base' would be incorrect for
canceled threads, leading to a misdiagnosed VM stack overflow.
See <http://lists.gnu.org/archive/html/bug-guile/2011-06/msg00068.html>
for details.
(scm_leave_guile_cleanup): Remove because it's unused.
Ludovic Courtès [Thu, 30 Jun 2011 14:36:03 +0000 (16:36 +0200)]
Add `guile-invoke.texi' to the distribution.
* doc/ref/Makefile.am (guile_TEXINFOS): Add `guile-invoke.texi'.
Andy Wingo [Thu, 30 Jun 2011 14:07:17 +0000 (16:07 +0200)]
fix generation of auto-compiled file names on mingw systems
* libguile/load.c (canonical_to_suffix, scm_primitive_load_path):
* module/ice-9/boot-9.scm (load-in-vicinity):
* module/system/base/compile.scm (compiled-file-name): If the canonical
path of a file is a DOS-style path with a drive letter, turn it into a
path suffix it by removing the colon and prefixing a "/".
Inspired by a patch from Jan Nieuwenhuizen.
Mark Harig [Mon, 25 Apr 2011 15:33:22 +0000 (11:33 -0400)]
better invocation documentation
* doc/ref/guile.texi (Programming in Scheme):
* doc/ref/scheme-scripts.texi (Guile Scripting): Moved "Invoking Guile"
to its own file.
* doc/ref/guile-invoke.texi (Invoking Guile): Initial revision. This
file contains the former section "Invoking Guile" that was included in
the chapter "Programming in Scheme" as a subsection named
"Command-line Options." It also includes a new subsection "Environment
Variables," which describes those variables that can be set in the
operating system before Guile is started and which affect Guile's
run-time behavior.
Andy Wingo [Thu, 30 Jun 2011 10:56:12 +0000 (12:56 +0200)]
%load-hook not just for primitive-load
* libguile/load.c (scm_primitive_load_path):
* module/ice-9/boot-9.scm (load-in-vicinity): Call %load-hook as needed.
Andy Wingo [Thu, 30 Jun 2011 10:26:31 +0000 (12:26 +0200)]
fix --disable-modules build
* configure.ac (HAVE_MODULES): Define HAVE_MODULES iff
--enable-modules.
* libguile/deprecated.c (scm_dynamic_args_call)
* libguile/extensions.c (load_extension):
* libguile/init.c (scm_i_init_guile): Use HAVE_MODULES in a few places.
Andy Wingo [Thu, 30 Jun 2011 09:32:09 +0000 (11:32 +0200)]
HAVE_POSIX warning fix
* libguile/filesys.c (scm_dir_free, scm_dir_print): Don't compile when
not HAVE_POSIX.
Ludovic Courtès [Tue, 28 Jun 2011 13:25:22 +0000 (15:25 +0200)]
Fix lock ordering in `fat_mutex_lock' to match that of `do_thread_exit'.
Original Helgrind report:
==14160== Thread #57: lock order "0x47F6B90 before 0x7C25A28" violated
==14160== at 0x4C27730: pthread_mutex_lock (in /.../valgrind-3.6.0/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==14160== by 0x4EFF87E: do_thread_exit (threads.c:664)
==14160== by 0x4E87B89: c_body (continuations.c:512)
==14160== by 0x4F16C21: vm_regular_engine (vm-i-system.c:960)
==14160== by 0x4E90F92: scm_call_4 (eval.c:506)
==14160== by 0x4E88372: scm_i_with_continuation_barrier (continuations.c:450)
==14160== by 0x4E88424: scm_c_with_continuation_barrier (continuations.c:546)
==14160== by 0x51CA3AF: GC_call_with_gc_active (pthread_support.c:1128)
==14160== by 0x4EFF2E0: with_guile_and_parent (threads.c:206)
==14160== by 0x51C46B4: GC_call_with_stack_base (misc.c:1505)
==14160== by 0x4EFF447: scm_with_guile (threads.c:917)
==14160== by 0x51C46B4: GC_call_with_stack_base (misc.c:1505)
==14160== Required order was established by acquisition of lock at 0x47F6B90
==14160== at 0x4C27730: pthread_mutex_lock (in /.../valgrind-3.6.0/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==14160== by 0x4F00262: fat_mutex_lock (threads.c:1362)
==14160== by 0x4F004DA: scm_lock_mutex_timed (threads.c:1462)
==14160== by 0x4F16C09: vm_regular_engine (vm-i-system.c:898)
==14160== by 0x4E90F4D: scm_call_3 (eval.c:499)
==14160== by 0x4EFFA4C: really_launch (threads.c:975)
==14160== by 0x4E87B89: c_body (continuations.c:512)
==14160== by 0x4F16C21: vm_regular_engine (vm-i-system.c:960)
==14160== by 0x4E90F92: scm_call_4 (eval.c:506)
==14160== by 0x4E88372: scm_i_with_continuation_barrier (continuations.c:450)
==14160== by 0x4E88424: scm_c_with_continuation_barrier (continuations.c:546)
==14160== by 0x4EFF289: with_guile_and_parent (threads.c:874)
==14160== followed by a later acquisition of lock at 0x7C25A28
==14160== at 0x4C27730: pthread_mutex_lock (in /.../valgrind-3.6.0/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==14160== by 0x4F00352: fat_mutex_lock (threads.c:1374)
==14160== by 0x4F004DA: scm_lock_mutex_timed (threads.c:1462)
==14160== by 0x4F16C09: vm_regular_engine (vm-i-system.c:898)
==14160== by 0x4E90F4D: scm_call_3 (eval.c:499)
==14160== by 0x4EFFA4C: really_launch (threads.c:975)
==14160== by 0x4E87B89: c_body (continuations.c:512)
==14160== by 0x4F16C21: vm_regular_engine (vm-i-system.c:960)
==14160== by 0x4E90F92: scm_call_4 (eval.c:506)
==14160== by 0x4E88372: scm_i_with_continuation_barrier (continuations.c:450)
==14160== by 0x4E88424: scm_c_with_continuation_barrier (continuations.c:546)
==14160== by 0x4EFF289: with_guile_and_parent (threads.c:874)
* libguile/threads.c (fat_mutex_lock): In the `m->level == 0' case,
release M's lock before taking T's `admin_mutex'.
Stefan Israelsson Tampe [Fri, 17 Jun 2011 21:11:29 +0000 (23:11 +0200)]
psyntax: enable dotted tail patterns
* module/ice-9/psyntax.scm (syntax-case): enabled the use of a
general last cdr instead of just '() in matching with both
a ellipsis (p ...) and a last rest pattern (. q)
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Mon, 20 Jun 2011 08:03:22 +0000 (10:03 +0200)]
update stack growth direction check
* configure.ac: Pull stack growth direction check from upstream
autoconf. See
http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00035.html
for a discussion.
Ludovic Courtès [Sun, 19 Jun 2011 22:45:18 +0000 (00:45 +0200)]
Placate GCC in `test-ffi-lib.c'.
This fixes warnings saying "this decimal constant is unsigned only in
ISO C90".
* test-suite/standalone/test-ffi-lib.c (test_ffi_u32_, test_ffi_u32_u8,
test_ffi_u32_s64, test_ffi_s64_s64, test_ffi_u64_u8,
test_ffi_u64_s64): Mark constants as unsigned.
Ian Price [Sat, 11 Jun 2011 01:43:08 +0000 (02:43 +0100)]
Fix hygiene issues with `define-record-type'
* module/rnrs/records/syntactic.scm (define-record-type0, process-fields):
Preserve hygiene of record clauses.
* test-suite/tests/r6rs-records-syntactic.test ("record hygiene"):
Add tests.
Ludovic Courtès [Sun, 19 Jun 2011 14:39:22 +0000 (16:39 +0200)]
Comment on the Gnulib `clock-gettime' workaround.
* acinclude.m4: Remove `clock_time.m4' serial.
* configure.ac: Add URL of the discussion about `clock-gettime'.
Ludovic Courtès [Sun, 19 Jun 2011 14:30:56 +0000 (16:30 +0200)]
configure: Factorize code checking for `iconveh_' constants; use the cache.
* configure.ac: Remove code that determines the values of the `iconveh_'
constants. Use `GUILE_UNISTRING_ICONVEH_VALUES'. instead.
* acinclude.m4 (GUILE_UNISTRING_CONSTANT,
GUILE_UNISTRING_ICONVEH_VALUES): New macros.
Andy Wingo [Fri, 17 Jun 2011 17:57:24 +0000 (19:57 +0200)]
current-language really defaults to Scheme.
* module/system/base/language.scm (current-language): Default to 'scheme
here, rather than relying on *current-language* always being bound.
Thanks to 亚光唐 <texnician@gmail.com> for the report.
Andy Wingo [Fri, 17 Jun 2011 17:30:31 +0000 (19:30 +0200)]
fix invalid transformation of (values x) -> x, (+ x) -> x, etc
* module/language/tree-il/primitives.scm (+, *, cons*): In the case of
just one argument (the identity case), expand to (values x) instead of
just x. Fixes values truncation in that case.
(values): Likewise remove (values x) -> x translation, as the compiler
will do it for us, and this fixes (values (values 1 2)).
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Handle
`values' in a push context here.
* test-suite/tests/tree-il.test ("values"): Add some tests.
Andy Wingo [Fri, 17 Jun 2011 17:16:16 +0000 (19:16 +0200)]
add -Wformat to %auto-compilation-options
* module/ice-9/boot-9.scm (%auto-compilation-options): Add -Wformat to
the default warning set.
Andy Wingo [Fri, 17 Jun 2011 16:08:06 +0000 (18:08 +0200)]
better messages on failed autocompilation
* libguile/load.c (auto_compile_catch_handler):
* module/ice-9/boot-9.scm (load-in-vicinity): Nicer messages when
autocompilation fails.
Andy Wingo [Fri, 17 Jun 2011 15:08:06 +0000 (17:08 +0200)]
fix self tail recursion to different case-lambda clauses
http://savannah.gnu.org/bugs/?33362
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Rename
from flatten, as it really just takes a particular case. Instead of
iteratively compiling lambda cases through `comp', tail-call through
flatten-lambda-case. This allows code to see which case it's being
compiled in. Take advantage of that to limit the self-tail-call
optimization to self-calls to the same case -- otherwise we might be
jumping to a label without having reserved the right number of
locals.
(flatten-lambda): Adapt the caller.
* test-suite/tests/compiler.test ("case-lambda"): Add a test.
Andy Wingo [Fri, 17 Jun 2011 09:37:11 +0000 (11:37 +0200)]
fix AC_LANG_SOURCE warnings
* configure.ac: Fix annoying AC_LANG_SOURCE warnings.
Andy Wingo [Fri, 20 May 2011 16:48:33 +0000 (18:48 +0200)]
check for clock_getcpuclockid in gl_CLOCK_TIME
* acinclude.m4 (gl_CLOCK_TIME): It could be that clock_gettime is in
libc but clock_getcpuclockid is not, so check for that explicitly.
Andreas Rottmann [Fri, 17 Jun 2011 08:38:47 +0000 (10:38 +0200)]
Silence warnings for variables created by `generate-temporaries'
* module/ice-9/psyntax.scm (generate-temporaries): Give temporaries the
current module, so that they may be bound at the top level.
* module/ice-9/psyntax-pp.scm: Regenerate.
Andy Wingo [Thu, 16 Jun 2011 22:20:56 +0000 (00:20 +0200)]
remove win32-dirent.[ch]
* libguile/win32-dirent.c:
* libguile/win32-dirent.h: Remove these files. MinGW has opendir and
readdir support, I hear.
* configure.ac:
* libguile/filesys.c:
* libguile/Makefile.am: Adapt.
Jan Nieuwenhuizen [Tue, 15 Feb 2011 15:35:03 +0000 (16:35 +0100)]
mingw: use $APPDATA as a possible root for cachedir.
* libguile/load.c (scm_init_load_path) [MINGW32]: Fall back to using
$LOCALAPPDATA or $APPDATA if $XDG_CACHE_HOME and $HOME aren't set.
Andy Wingo [Thu, 16 Jun 2011 21:43:44 +0000 (23:43 +0200)]
add `rename' gnulib module
This should fix `rename' on mingw32.
Mark H Weaver [Thu, 16 Jun 2011 19:07:30 +0000 (15:07 -0400)]
Fix several POSIX functions to use the locale encoding
* libguile/strings.c (scm_i_allocate_string_pointers): Encode strings
using the current locale. Previously, Latin-1 was used. Indirectly,
this affects the encoding of strings in `system*', `execl', `execlp',
`execle', `environ', and `dynamic-args-call'.
(scm_makfromstrs): In header comment, clarify that the C strings are
interpreted according to the current locale encoding.
* NEWS: Add NEWS entry.
Andy Wingo [Thu, 16 Jun 2011 16:27:57 +0000 (18:27 +0200)]
O_CLOEXEC usage
* libguile/objcodes.c (scm_load_objcode):
* libguile/scmsigs.c (start_signal_delivery_thread):
* libguile/threads.c (guilify_self_1): Use O_CLOEXEC.
Andy Wingo [Thu, 16 Jun 2011 16:22:50 +0000 (18:22 +0200)]
gnulib update
Added pipe2 and open modules, to get O_CLOEXEC.
* libguile/Makefile.am (guile_filter_doc_snarfage$(EXEEXT)): Add gnulib
here, in the native build case, for rpl_fflush if needed.
foo
Andy Wingo [Thu, 16 Jun 2011 17:35:14 +0000 (19:35 +0200)]
fix initial values of reallocated fluids
* libguile/threads.h:
* libguile/threads.c (scm_i_reset_fluid): New internal function, resets
the binding of a fluid for all threads. Needed for fluid GC.
* libguile/fluids.c (new_fluid): Call scm_i_reset_fluid here.
Andy Wingo [Thu, 16 Jun 2011 13:59:19 +0000 (15:59 +0200)]
more NEWS
* NEWS: More updates.
Andy Wingo [Thu, 16 Jun 2011 11:29:17 +0000 (13:29 +0200)]
update NEWS
* NEWS: Update for 2.0.2.
Andy Wingo [Thu, 16 Jun 2011 11:01:43 +0000 (13:01 +0200)]
add docs for shift and reset
* doc/ref/api-control.texi (Prompt Primitives): Break call-with-prompt
and abort-to-prompt out into a subsubsection.
(Shift and Reset): New subsubsection.
Andy Wingo [Thu, 16 Jun 2011 10:06:43 +0000 (12:06 +0200)]
fix hash-set! on weak tables
* test-suite/tests/weaks.test: Add tests.
* libguile/hashtab.c (scm_hash_fn_set_x): Fix updates to weak-value hash
tables to not deadlock inside the alloc lock.
Andreas Rottmann [Thu, 9 Jun 2011 20:11:02 +0000 (22:11 +0200)]
Fix likely crash in `stable-sort!'
* libguile/sort.c (scm_stable_sort_x): Properly handle zero-length
vectors.
* test-suite/tests/sort.test ("stable-sort"): Add test for this case.
Ludovic Courtès [Wed, 8 Jun 2011 21:19:37 +0000 (23:19 +0200)]
doc: Mention the former name of `guild'.
* doc/ref/scheme-using.texi (Using Guile Tools): Add a footnote
mentioning that `guild' used to be `guile-tools'.
* doc/ref/tools.texi (Executable Modules): Nitpicks.
Andy Wingo [Tue, 31 May 2011 20:36:52 +0000 (22:36 +0200)]
add guild docs
* doc/ref/scheme-using.texi (Using Guile Tools): Add some optimistic
guild docs.
Andy Wingo [Mon, 30 May 2011 21:02:03 +0000 (23:02 +0200)]
rename `guile-tools' to `guild'
* configure.ac: Look for ln -s. Write out `guild' instead of
`guile-tools'.
* meta/Makefile.am (install-data-hook): Link the installed `guild' to
the backward-compatible `guile-tools' name.
(bin_SCRIPTS, EXTRA_DIST): Fix up for guild change.
* meta/guild.in: Moved here from `guile-tools.in'.
* doc/ref/Makefile.am (autoconf-macros.texi):
* doc/ref/api-evaluation.texi (Compilation):
* doc/ref/autoconf.texi (Autofrisk, Using Autofrisk):
* doc/ref/mod-getopt-long.texi (getopt-long Reference):
* doc/ref/tools.texi (Miscellaneous Tools, Executable Modules): Minimal
doc update.
* .gitignore:
* am/guilec (.scm.go):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.go): Update makefiles, etc.
* module/scripts/README:
* module/scripts/lint.scm:
* module/scripts/list.scm: Update commentaries.
Andy Wingo [Mon, 30 May 2011 20:18:48 +0000 (22:18 +0200)]
write-objcode uses target-endianness, target-word-size
* libguile/_scm.h (SCM_OBJCODE_ENDIANNESS_OFFSET):
(SCM_OBJCODE_WORD_SIZE_OFFSET): New defines.
* libguile/objcodes.c (scm_write_objcode): Use target-endianness and
target-word-size when writing the objcode cookie.
Andy Wingo [Fri, 27 May 2011 11:29:45 +0000 (13:29 +0200)]
compile-bytecode uses target-endianness
* module/language/assembly/compile-bytecode.scm (compile-bytecode):
Use target-endianness, from (system base target).
Andy Wingo [Mon, 30 May 2011 19:28:30 +0000 (21:28 +0200)]
add (system base target)
* module/Makefile.am:
* module/system/base/target.scm: Add a minimal module to parameterize
the target system type and inspect properties on it like cpu, vendor,
os, endianness, and word size.
Andy Wingo [Mon, 30 May 2011 09:33:10 +0000 (11:33 +0200)]
fix subtle and bad scm_internal_hash_fold bug for weak tables
* libguile/hashtab.c (scm_internal_hash_fold): Don't try to unlink
deleted weak pairs. Our previous code was buggy (`prev' should have
only been updated in the case of a successful traversal), but more
than that, we're not in the alloc lock.
Thanks very much to Michael Wells for the report, and the debugging!
Andreas Rottmann [Fri, 27 May 2011 14:09:04 +0000 (16:09 +0200)]
Tweak R6RS transcoded ports flushing
* libguile/r6rs-ports.c (tp_flush): Only operate on the underlying port
when it is open.
Andreas Rottmann [Fri, 27 May 2011 13:32:01 +0000 (15:32 +0200)]
rnrs io ports: fix port encoding when opening file ports
* module/rnrs/io/ports.scm (open-file-input-port)
(open-file-output-port): Ensure the resulting ports are binary when no
transcoder is specified.
* test-suite/tests/r6rs-ports.test: Remove superfluous global change of
`%default-port-encoding' and accompanying comment.
("7.2.7 Input Ports"): Add test ensuring `open-file-input-port' opens
a binary port when no transcoder is specified.
("8.2.10 Output ports"): Strengthen existing `open-file-output-port'
binary-ness test by setting `%default-port-encoding' to "UTF-8".
Andreas Rottmann [Fri, 27 May 2011 12:48:31 +0000 (14:48 +0200)]
Add some tests for the R6RS I/O libraries
* test-suite/tests/r6rs-ports.test
(call-with-bytevector-output-port/transcoded): New helper procedure.
("8.2.6 Input and output ports"): Use that helper procedure.
(encoding-error-predicate): New helper procedure.
("8.2.12 Textual Output"): Add tests for `put-char' and `put-string'
exception behavior on encoding errors.
Neil Jerram [Thu, 26 May 2011 21:02:16 +0000 (22:02 +0100)]
Doc for getopt-long's new stop-at-first-non-option option
* doc/ref/mod-getopt-long.texi (getopt-long): Mention optional keyword
parameters.
(getopt-long Reference): Document #:stop-at-first-non-option.
Neil Jerram [Thu, 26 May 2011 20:30:05 +0000 (21:30 +0100)]
Remove unused script-getopt.texi
* doc/ref/Makefile.am (guile_TEXINFOS): Remove script-getopt.texi.
* doc/ref/script-getopt.texi: Deleted. This file wasn't included in
the manual, and its content is now duplicated identically in
scheme-scripts.texi.
Neil Jerram [Thu, 12 May 2011 22:16:05 +0000 (23:16 +0100)]
Emit a 1-based line number in error messages
* module/ice-9/boot-9.scm (exception-printers): Add 1 to the 0-based
line number.
Neil Jerram [Sun, 8 May 2011 21:51:07 +0000 (22:51 +0100)]
Reveal guile-tools's inner simplicity...
...by not using its own-rolled getopt, and moving the `list' function
to a separate script
* meta/guile-tools.in: Use (ice-9 getopt-long).
(directory-files, strip-extensions, unique, find-submodules,
list-scripts): Deleted (and moved to new `list.scm' file).
(getopt): Deleted.
(main): Use getopt-long. Default to calling the `list' script if no
script is specified.
* module/scripts/list.scm: New script.
* module/Makefile.am (SCRIPTS_SOURCES): Add list.scm.
Neil Jerram [Sun, 8 May 2011 21:21:51 +0000 (22:21 +0100)]
Implement #:stop-at-first-non-option option for getopt-long
(For use by guile-tools)
* module/ice-9/getopt-long.scm: Use (ice-9 optargs) so we can use
define*.
(process-options): Add stop-at-first-non-option parameter. When
this is true, stop processing when we hit a non-option (so long as
that non-option isn't something that resulted from the unclumping of
a short option group).
(getopt-long): Add #:stop-at-first-non-option keyword; pass it on to
process-options.
* test-suite/tests/getopt-long.test ("stop-at-first-non-option"): New
test (for the above).
Neil Jerram [Thu, 26 May 2011 16:38:41 +0000 (17:38 +0100)]
Handle short option unclumping progressively, instead of all upfront
This is needed as a prerequisite for the following change that
introduces the stop-at-first-non-option option, because when that
option is used we don't know upfront how far through the command
line we should proceed with unclumping.
* module/ice-9/getopt-long.scm (expand-clumped-singles): Delete.
(process-options): Add a loop variable to indicate how many elements
at the start of `argument-ls' are known not to be clumped. When we
see a short option and this variable is <= 0, perform unclumping
(using code that used to be in expand-clumped-singles) and loop with
the variable > 0.
(getopt-long): Don't call expand-clumped-singles upfront here.
Neil Jerram [Sun, 8 May 2011 20:52:01 +0000 (21:52 +0100)]
Simplify getopt-long handling of option values, esp with multiple occurrences
Basically, accumulate values in the `process-options' loop variables,
instead of using set-option-spec-value!
* module/ice-9/getopt-long.scm (option-spec): Delete the `value' slot.
(process-options): Delete `val!loop' and just use `loop' everywhere
instead. When adding an option spec to `found', add the
corresponding value too; hence `found' becomes an alist, where it
was previously a list of specs.
(getopt-long): Use assq-ref to get values out of `found'. Remove
unhittable error condition for detecting an option that requires an
explicit value, where a value wasn't supplied. This condition is
actually caught and handled in `process-options'. Rewrite the end
of the procedure much more simply.
Neil Jerram [Sun, 8 May 2011 20:36:54 +0000 (21:36 +0100)]
Fix "occurrances" typos in getopt-long code and test
* module/ice-9/getopt-long.scm (process-options, getopt-long): Change
to "occurrences".
* test-suite/tests/getopt-long.test ("multiple occurrences"): Same
again.
Andy Wingo [Thu, 26 May 2011 16:29:05 +0000 (18:29 +0200)]
leave guile when reading signal pipe
* libguile/scmsigs.c (read_signal_pipe_data, signal_delivery_thread):
Leave guile when reading from the signal pipe. Hopefully that lets GC
know not to wake up this thread.
Andy Wingo [Thu, 26 May 2011 16:14:32 +0000 (18:14 +0200)]
lazily init futures worker pool
* module/ice-9/futures.scm (%workers, %create-workers!)
(create-workers!): Define a mechanism to spawn off the future threads
only when the first future is created.
(make-future): Call create-workers! here.
Andy Wingo [Thu, 26 May 2011 13:58:42 +0000 (15:58 +0200)]
remove scm_newcell_count, scm_newcell2_count
* libguile/inline.h:
* libguile/gc.c: Remove declaration and definition of unused
"scm_newcell_count" and "scm_newcell2_count". Since SCM_INTERNAL is
"extern", these symbols were not externally visible anyway, at least
under Linux or Windows.
Andy Wingo [Thu, 26 May 2011 10:34:30 +0000 (12:34 +0200)]
deprecate scm_immutable_{double_,}cell
* libguile/inline.h:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_immutable_cell, scm_immutable_double_cell):
Deprecate these, as the GC_STUBBORN API doesn't do anything any more.
* libguile/strings.c (scm_i_c_make_symbol): Change the one use of
scm_immutable_double_cell to scm_double_cell.
Mark H Weaver [Wed, 25 May 2011 16:31:21 +0000 (12:31 -0400)]
Clarify docs for SCM_UNSPECIFIED: used sometimes but not always
* doc/ref/data-rep.texi (Immediate objects): Clarify the description
of SCM_UNSPECIFIED. It is returned by some (but not all) expressions
whose value is unspecified by the Scheme standard.
Andy Wingo [Wed, 25 May 2011 08:27:46 +0000 (10:27 +0200)]
out-of-tree build fix
* test-suite/standalone/Makefile.am (GUILE_AUTO_COMPILE): Add srcdir to
the environment.
* test-suite/standalone/test-import-order: Look for the modules in the
srcdir. Fixes out-of-tree builds.
Andy Wingo [Tue, 24 May 2011 20:52:39 +0000 (22:52 +0200)]
threadsafe addition to the goops vtable_class_map
* libguile/goops.c (scm_i_define_class_for_vtable): Lock around
additions to the vtable_class_map. Use is unlocked though; solving
GOOPS parallel-initialization would be a good thing.
Andy Wingo [Tue, 24 May 2011 20:46:09 +0000 (22:46 +0200)]
threadsafe access to source properties weak hash table
* libguile/srcprop.c: Add a lock around scm_source_whash, and use it.
Andy Wingo [Tue, 24 May 2011 19:25:11 +0000 (21:25 +0200)]
read + source properties simplification
* libguile/srcprop.h: Remove internal scm_source_whash declaration.
* libguile/srcprop.c (scm_i_set_source_properties_x)
(scm_i_has_source_properties): New helpers.
(scm_source_whash): Make static.
* libguile/read.c (scm_read_sexp): Remove register declarations here;
let's trust the compiler. Remove code to incrementally build up a
copy; instead let's let scm_i_set_source_properties_x handle copying
the expression if needed.
(scm_read_quote, scm_read_syntax): Use scm_i_set_source_properties_x.
(recsexpr): Remove this helper from 1996.
(scm_read_sharp_extension): Instead of trying to recursively label
sharp-read subforms with source properties, just label the outside
form and rely on the macro-expander to propagate it down.
Andy Wingo [Tue, 24 May 2011 19:09:24 +0000 (21:09 +0200)]
safely access the trampoline weak map
* libguile/smob.c (scm_i_smob_apply_trampoline): Protect the trampoline
weak map with a mutex.
Andy Wingo [Mon, 23 May 2011 20:38:13 +0000 (22:38 +0200)]
set-procedure-property! threadsafety issue
* libguile/procprop.c (scm_set_procedure_property_x): Fix a threadsafety
bug pointed out by Ken Raeburn.
Andy Wingo [Mon, 23 May 2011 20:24:27 +0000 (22:24 +0200)]
really threadsafe access to symbol table
* libguile/symbols.c (symbols_lock): Rename from intern_lock.
(lookup_interned_symbol, lookup_interned_latin1_symbol): Instead of
faith-based programming, just use the mutex. Though I haven't seen
this break, Ken is right!
Mark H Weaver [Sun, 22 May 2011 19:23:27 +0000 (15:23 -0400)]
Don't call scm_lock_mutex and scm_unlock_mutex via pointer of wrong type
* libguile/threads.c (lock_mutex_return_void, unlock_mutex_return_void):
New static functions that simply call scm_lock_mutex and
scm_unlock_mutex, respectively, but return void instead of SCM.
(scm_dynwind_lock_mutex): Pass unlock_mutex_return_void to
scm_dynwind_unwind_handler_with_scm, and lock_mutex_return_void to
scm_dynwind_rewind_handler_with_scm. Previously, we passed
scm_unlock_mutex and scm_lock_mutex (which return SCM), but the
scm_dynwind_* functions expect pointers to functions which return
void. When SCM is of type union, this changes the calling conventions
of the functions on some platforms (e.g. GCC 4.5.2 and 4.5.3 on x86).
Andy Wingo [Sat, 21 May 2011 16:29:03 +0000 (18:29 +0200)]
fix define-module ordering
* module/ice-9/boot-9.scm (define-module): Fix to load the #:use-module
clauses in the order in which they appear in the define-module form.
Thanks to Jan Nieuwenhuizen for the report.
* test-suite/standalone/test-import-order: Add new test that
define-module and use-modules resolve the interface in the right
order.
* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-import-order-a.scm:
* test-suite/standalone/test-import-order-b.scm:
* test-suite/standalone/test-import-order-c.scm:
* test-suite/standalone/test-import-order-d.scm: Aux files.
Andy Wingo [Sat, 21 May 2011 11:12:44 +0000 (13:12 +0200)]
(syntax foo) -> #'foo in goops
* module/oop/goops.scm: Change instances of (syntax foo) to #'foo.
Andy Wingo [Fri, 20 May 2011 15:41:06 +0000 (17:41 +0200)]
clocktime freebsd portability
* libguile/stime.c (HAVE_POSIX_CPUTIME): Hack around buggy FreeBSD
implementation of _POSIX_CPUTIME.
Andy Wingo [Fri, 20 May 2011 10:50:08 +0000 (12:50 +0200)]
fix compile error in mingw fstat socket detection
* libguile/filesys.c (fstat_Win32) [__MINGW32__]: Apparently there is no
_S_IFSOCK on mingw32. Thanks to Volker Grabsch for the report.
Andy Wingo [Fri, 20 May 2011 10:26:53 +0000 (12:26 +0200)]
gen-scmconfig cross-compilation fix
* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Fix
cross-compilation. Thanks to Volker Grabsch for the report!
Andy Wingo [Fri, 20 May 2011 09:54:46 +0000 (11:54 +0200)]
fix documentation for option-set! syntaxen
* doc/ref/api-evaluation.texi (Scheme Read): Note that read-set! is
syntax.
(Scheme Write): Likewise for print-set!.
* doc/ref/api-io.texi (Writing): Remove reference to
print-options-interface.
* doc/ref/repl-modules.texi (Readline Options): Update, and add entries
for readline-options, readline-set! et al.
Andreas Rottmann [Sat, 14 May 2011 17:29:26 +0000 (19:29 +0200)]
Improve R6RS conformance wrt. conditions in the I/O libraries
* module/rnrs/io/ports.scm (open-file-output-port): Handle `no-fail'
file option.
(with-i/o-filename-conditions): Use `with-throw-handler' instead of `catch'.
(with-i/o-port-error,
with-textual-output-conditions. with-textual-input-conditions): New
exception-conversion helpers.
(put-char, put-datum, put-string, display): Use
`with-textual-output-conditions' instead of `with-i/o-encoding-error'
to get proper conditions in case of write errors.
(get-char, get-datum, get-line, get-string-all, lookahead-char):
Likewise, for the input case.
* test-suite/tests/r6rs-ports.test (pass-if-condition, test-file,
make-failing-port): New helpers.
("8.2.10 Output ports"): Add some tests for `open-file-output-port'.
("8.2.9 Textual Input"): Add tests read error conditions.
("8.2.12 Textual Output"): Add tests for write error conditions.
("8.3 Simple I/O"): Add tests for conditions, `call-with-input-file'
and `call-with-output-file'.
Andy Wingo [Fri, 13 May 2011 11:33:59 +0000 (13:33 +0200)]
refactor do_thread_exit cleanup handler invocation
* libguile/threads.c (do_thread_exit): Redo cleanup handler call so as
not to shove a SCM into a pointer.
Andy Wingo [Fri, 13 May 2011 11:29:48 +0000 (13:29 +0200)]
i18n error return type fix
* libguile/i18n.c (chr_to_case, str_to_case): Return #f in error case
instead of 0.
Andy Wingo [Fri, 13 May 2011 11:29:15 +0000 (13:29 +0200)]
PTR2SCM and SCM2PTR in inline.h
* libguile/inline.h (scm_cell, scm_immutable_cell):
(scm_double_cell, scm_immutable_double_cell):
(scm_words): Be more consistent in use of PTR2SCM and SCM2PTR.
Andy Wingo [Fri, 13 May 2011 11:25:14 +0000 (13:25 +0200)]
compile-time assertion in net_db uses constant expressions
* libguile/net_db.c: Use constant expressions for EAI_BADFLAGS and
AI_ALL representations.