bpt/guile.git
14 years agoremove cache-mutex slot from generics
Andy Wingo [Sun, 8 Nov 2009 10:34:30 +0000 (11:34 +0100)]
remove cache-mutex slot from generics

* libguile/goops.c:
* libguile/goops.h: Remove cache-mutex slot from generics, and renumber
  other slots.

14 years agoremove locking in method memoization
Andy Wingo [Sun, 8 Nov 2009 10:29:48 +0000 (11:29 +0100)]
remove locking in method memoization

* libguile/goops.c (scm_memoize_method): Don't lock around method
  memoization, as the new protocol will be reeentrant and lock-free.

14 years agolimn goops flags, remove foreign objs, rename entity to applicable-struct
Andy Wingo [Sun, 8 Nov 2009 10:24:23 +0000 (11:24 +0100)]
limn goops flags, remove foreign objs, rename entity to applicable-struct

* libguile/goops.c (scm_class_applicable_struct)
  (scm_class_applicable_struct_with_setter)
  (scm_class_applicable_struct_class): Rename from
  scm_class_entity, scm_class_entity_with_setter, and
  scm_class_entity_class.
  (scm_class_simple_method): Removed; this abstraction is not used.
  (scm_class_foreign_class, scm_class_foreign_object): Remove these,
  they are undocumented and unused. They might come back later.
  (scm_sys_inherit_magic_x): Simply inherit the vtable flags from the
  class's class. Flags are about layout, and it is the class that
  determines the layout of the instance.
  (scm_basic_basic_make_class): Don't bother setting GOOPS_OR_VALID,
  inherit-magic will do that.
  (scm_basic_make_class): Inherit magic after setting the layout. Allows
  the struct magic checker to do its job.
  (scm_accessor_method_slot_definition): Move implementation to Scheme.
  Removes the need for the accessor flag.
  (scm_sys_allocate_instance): Adapt to scm_i_alloc_struct name change,
  and that alloc-struct will handle finalization.
  (scm_compute_applicable_methods): Remove accessor check, as it's
  unnecessary.
  (scm_make): Adapt to new generic slot order, and no more
  simple-method.
  (create_standard_classes): What was the GF slot "dispatch-procedure"
  is now the applicable-struct slot "procedure". No more foreign class,
  foreign object, or simple method. Rename <entity> and friends to
  <applicable-struct> and friends. No more entity-with-setter -- though
  perhaps it will come back too. Instead generic-with-setter is its own
  thing.

* libguile/goops.h (SCM_CLASSF_METACLASS): "A goops class that is a
  vtable" -- no need for a separate flag.
  (SCM_CLASSF_FOREIGN, SCM_CLASSF_SIMPLE_METHOD)
  (SCM_CLASSF_ACCESSOR_METHOD): Removed these unused flags.
  (SCM_ACCESSORP): Removed.
  Renumber generic slots, rename entity classes, and remove the foreign
  class, foreign object, and simple method classes.

* libguile/struct.c (scm_i_struct_inherit_vtable_magic): New function,
  called when making new vtables.applicable structs
  (scm_i_alloc_struct): Remove 8-bit alignment check, as libGC
  guarantees this for us. Handle finalizer registration here.
  (scm_make_struct): Factor some things to scm_i_alloc_struct and
  scm_i_struct_inherit_vtable_magic.
  (scm_make_vtable_vtable): Adapt to scm_i_alloc_struct name change.

* libguile/struct.h (scm_i_alloc_struct): Change name from
  scm_alloc_struct, and make internal.

* module/oop/goops.scm (oop): Don't declare #:replace <class> et al,
  because <class> isn't defined in the core any more.
  (accessor-method-slot-definition): Defined in Scheme now.
  Remove <foreign-object> methods.
  (initialize on <class>): Prep layout before inheriting magic, as in
  scm_basic_make_class.

* module/oop/goops/dispatch.scm (delayed-compile)
  (memoize-effective-method!): Adapt to 'procedure slot name change.

14 years ago%invalidate-method-cache invalidates the dispatch procedure too
Andy Wingo [Fri, 6 Nov 2009 16:17:33 +0000 (17:17 +0100)]
%invalidate-method-cache invalidates the dispatch procedure too

* libguile/goops.c (make_dispatch_procedure, clear_method_cache):
  Properly reset the dispatch procedure.

14 years agogeneric dispatch protocol in scheme, not yet wired up
Andy Wingo [Fri, 6 Nov 2009 10:25:50 +0000 (11:25 +0100)]
generic dispatch protocol in scheme, not yet wired up

* module/oop/goops/dispatch.scm: Add a dispatch protocol in Scheme. The
  idea is that instead of using a hardcoded C protocol, we compile
  dispatch procedures at runtime. To avoid too much thrashing at bootup,
  there is a simple JIT mechanism -- dispatch will be data-driven,
  through the cache, for the first 5 invocations, then a dispatch
  procedure will be compiled from the cache.

  My initial timings indicate that interpreted dispatch takes about
  100us, and that compiled dispatch takes about 60us. Compilation itself
  takes about 16000us (16 ms). The compiled procedure dispatch times
  will improve soon, hopefully.

14 years agoeqv? not a generic, equal? dispatches to generic only for objects
Andy Wingo [Fri, 6 Nov 2009 09:27:19 +0000 (10:27 +0100)]
eqv? not a generic, equal? dispatches to generic only for objects

* libguile/eq.c (scm_eqv_p): Not a generic any more. Since eqv? is used
  by e.g. `case', which should be able to compile into dispatch tables,
  it really doesn't make sense to dispatch out to a generic.
  (scm_equal_p): So it was always the case that (equal? 'foo "foo") =>
  #f. But (equal? 'foo 'bar) could actually be extended by a generic.
  This was a bug, if you follow the other logic of the code. Changed so
  that generic functions can only extend the domain of equal? when
  operating on goops objects.

* oop/goops.scm: No more eqv? generic.

* test-suite/tests/goops.test: Remove eqv? tests.

14 years agogeneric tweaks; realizing what the setter slot actually is
Andy Wingo [Thu, 5 Nov 2009 16:35:44 +0000 (17:35 +0100)]
generic tweaks; realizing what the setter slot actually is

* libguile/goops.h (scm_si_dispatch_procedure)
  (scm_si_effective_methods): Rename the new generics slots to
  "effective-methods" and "dispatch-procedure".
  (scm_si_generic_setter): Rename this one from "%setter" to "setter",
  and it's not a cache -- it's a pointer to the setter, which is also a
  generic. I didn't realize that before. It's better this way (like it
  always was.)
  (SCM_SET_GENERIC_DISPATCH_PROCEDURE)
  (SCM_CLEAR_GENERIC_EFFECTIVE_METHODS): New helper macros.

* libguile/goops.c (clear_method_cache): Clear the new dispatch
  procedure and the effective methods as well.
  (create_standard_classes): Rename slots, and fix the setter slots.

14 years agomore clarity in (oop goops dispatch)
Andy Wingo [Thu, 5 Nov 2009 12:16:40 +0000 (13:16 +0100)]
more clarity in (oop goops dispatch)

* module/oop/goops/dispatch.scm (memoize-method!): If we don't have a
  no-applicable-method, just call no-applicable-method directly.

* test-suite/tests/goops.test ("no-applicable-method"): Add some tests.

14 years agoremove code-table slot from methods
Andy Wingo [Thu, 5 Nov 2009 11:54:41 +0000 (12:54 +0100)]
remove code-table slot from methods

* libguile/goops.c (scm_sys_invalidate_method_cache_x, scm_make)
  (create_standard_classes): Remove code-table slot from methods. The
  generic cache completely does its job, afaict.

* libguile/goops.h (scm_si_formals, scm_si_body, scm_si_make_procedure):
  Renumber slots.

* module/oop/goops.scm (initialize on <method>): No more code-table
  slot.

* module/oop/goops/compile.scm: Always "compile" a method, instead of
  looking for a hit in an always-empty cache.

14 years agoremove used-by slot from generics
Andy Wingo [Thu, 5 Nov 2009 11:41:54 +0000 (12:41 +0100)]
remove used-by slot from generics

* libguile/goops.c (clear_method_cache)
  (scm_sys_invalidate_method_cache_x, scm_make)
  (create_standard_classes): Remove the used-by method from generics, as
  it is not used at all.

* libguile/goops.h: Renumber generic slots.

* module/oop/goops/dispatch.scm (memoize-method!): No more used-by slot.

14 years agofirst step towards effective methods
Andy Wingo [Thu, 5 Nov 2009 10:32:16 +0000 (11:32 +0100)]
first step towards effective methods

* libguile/goops.c (create_standard_classes):
* libguile/goops.h *scm_si_applicable_methods, scm_si_effective_method)
  (scm_si_applicable_setter_methods, scm_si_effective_setter_method):
  Add space for the new form of the generic cache and effective method.

14 years agoa very big commit cleaning up structs & goops. also applicable structs.
Andy Wingo [Tue, 3 Nov 2009 22:59:51 +0000 (23:59 +0100)]
a very big commit cleaning up structs & goops. also applicable structs.

I tried to split this one, and I know it's a bit disruptive, but this
stuff really is one big cobweb. So instead we'll pretend like these are
separate commits, by separating the changelog.

Applicable struct runtime support.

* libguile/debug.c (scm_procedure_source):
* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
  (scm_trampoline_2):
* libguile/eval.i.c (CEVAL):
* libguile/goops.c (scm_class_of):
* libguile/procprop.c (scm_i_procedure_arity):
* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Allow
  for applicable structs. Whee!

* libguile/deprecated.h (scm_vtable_index_vtable): Define as a synonym
  for scm_vtable_index_self.
  (scm_vtable_index_printer): Alias scm_vtable_index_instance_printer.
  (scm_struct_i_free): Alias scm_vtable_index_instance_finalize.
  (scm_struct_i_flags): Alias scm_vtable_index_flags.
  (SCM_STRUCTF_FLAGS): Be a -1 mask, we have a whole word now.
  (SCM_SET_VTABLE_DESTRUCTOR): Implement by hand.

Hidden slots.

* libguile/struct.c (scm_make_struct_layout): Add support for "hidden"
  fields, writable fields that are not visible to make-struct. This
  allows us to add fields to vtables and not break existing make-struct
  invocations.
  (scm_struct_ref, scm_struct_set_x): Always get struct length from the
  vtable. Support hidden fields.

* libguile/goops.c (scm_class_hidden, scm_class_protected_hidden): New
  slot classes, to correspond to the new vtable slots.
  (scm_sys_prep_layout_x): Turn hidden slots into 'h'.
  (build_class_class_slots): Reorder the class slots to account for
  vtable fields coming out of negative-land, for name as a vtable slot,
  and for hidden fields.
  (create_standard_classes): Define <hidden-slot> and
  <protected-hidden-slot>.

Clean up struct.h.

* libguile/struct.h: Lay things out cleaner. There are no more hidden
  (negative) words. Names are nicer. The exposition is nicer. But the
  basics are the same. The incompatibilities are that <vtable> has more
  slots now, and that scm_alloc_struct's signature has changed. The
  former is ameliorated by the "hidden" slots mentioned before, and the
  latter, well, it was always a very internal thing...
  (scm_t_struct_finalize): New type, a finalizer function to be run when
  instances of a vtable are collected.
  (scm_t_struct_free): Removed, structs' data is managed by the GC now,
  and not freed by vtable functions.

* libguile/struct.c: (scm_vtable_p): Now we keep flags on
  vtable-vtables, so this check is cheaper.
  (scm_alloc_struct): No hidden words. Yippee.
  (struct_finalizer_trampoline): Entersify.
  (scm_make_struct): No need to babysit extra words, though now we have
  to babysit flags. Propagate the vtable, applicable, and setter flags
  appropriately.
  (scm_make_vtable_vtable): Update for new simplicity.
  (scm_print_struct): A better printer.
  (scm_init_struct): Define <applicable-struct-vtable>, a magical vtable
  like CL's funcallable-standard-class. Also define
  <applicable-struct-with-setter-vtable>.

Remove foreign object implementation.

* libguile/goops.h:
* libguile/goops.c (scm_make_foreign_object, scm_make_class)
  (scm_add_slot, scm_wrap_object, scm_wrap_component): Remove, these
  were undocumented and unworking.

Clean up goops.h, a little.

* libguile/goops.h:
* libguile/goops.c: Also clean up.
* module/oop/goops/dispatch.scm (hashset-index): Adapt for new hashset
  index.

14 years agoRemove uses of discouraged constructs.
Ludovic Courtès [Wed, 25 Nov 2009 22:46:17 +0000 (23:46 +0100)]
Remove uses of discouraged constructs.

* libguile/vm-i-scheme.c, libguile/vm-i-system.c, libguile/vm.c: Replace
  uses of discouraged constructs by their current counterparts.

14 years agoDon't build `inet-aton' and `inet-ntoa' when --disable-networking.
Ludovic Courtès [Wed, 25 Nov 2009 22:44:14 +0000 (23:44 +0100)]
Don't build `inet-aton' and `inet-ntoa' when --disable-networking.

* libguile/deprecated.c (scm_inet_aton, scm_inet_ntoa): Conditionalize
  on `HAVE_NETWORKING'.

14 years agoUse $(PATH_SEPARATOR) where appropriate.
Ludovic Courtès [Tue, 24 Nov 2009 22:43:27 +0000 (23:43 +0100)]
Use $(PATH_SEPARATOR) where appropriate.

* examples/Makefile.am (AM_CFLAGS, AM_LIBS): Use $(PATH_SEPARATOR)
  instead of `:'.
  (installcheck): Likewise.

14 years agoFix makefile indentation.
Ludovic Courtès [Tue, 24 Nov 2009 22:39:10 +0000 (23:39 +0100)]
Fix makefile indentation.

* benchmark-suite/Makefile.am, libguile/Makefile.am, meta/Makefile.am:
  Use TAB instead of 8 spaces...

* .x-sc_makefile_check: New file.

14 years agoProperly quote the first argument to `AC_DEFINE{,_UNQUOTED}'.
Ludovic Courtès [Tue, 24 Nov 2009 22:34:37 +0000 (23:34 +0100)]
Properly quote the first argument to `AC_DEFINE{,_UNQUOTED}'.

* acinclude.m4, configure.ac, examples/compat/acinclude.m4: Properly
  quote the first argument for `AC_DEFINE' and `AC_DEFINE_UNQUOTED'.

* .x-sc_m4_quote_check: New file.

14 years agoAdd `cfg.mk', for use by the top-level GNUmakefile.
Ludovic Courtès [Tue, 24 Nov 2009 22:23:28 +0000 (23:23 +0100)]
Add `cfg.mk', for use by the top-level GNUmakefile.

* cfg.mk: New file, with 1.9.5 `NEWS' hash.

14 years ago"filesystem" -> "file system"
Ludovic Courtès [Tue, 24 Nov 2009 22:16:08 +0000 (23:16 +0100)]
"filesystem" -> "file system"

* doc/ref/misc-modules.texi, doc/sources/unix.texi,
  module/ice-9/ftw.scm: Replace "filesystem" by "file system".

14 years agoDon't rely on `HAVE_' macros in public header "tags.h".
Ludovic Courtès [Tue, 24 Nov 2009 22:12:03 +0000 (23:12 +0100)]
Don't rely on `HAVE_' macros in public header "tags.h".

* configure.ac: Check for `intptr_t' and `uintptr_t'.  Substitute
  `SCM_I_GSC_T_INTPTR' and `SCM_I_GSC_T_UINPTR'.

* libguile/__scm.h (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN,
  SCM_T_INTPTR_MAX): New macros.

* libguile/_scm.h (SIZEOF_SCM_T_BITS): New macro.

* libguile/gen-scmconfig.c (main): Produce typedefs for `scm_t_intptr'
  and `scm_t_uintptr'.

* libguile/gen-scmconfig.h.in (SCM_I_GSC_T_INTPTR, SCM_I_GSC_T_UINPTR):
  New macros.

* libguile/tags.h: Don't check for `HAVE_INTTYPES_H' and
  `HAVE_STDINT_H'; don't include <inttypes.h> nor <stdint.h>.
  (scm_t_signed_bits, scm_t_bits): Define unconditionally as aliases for
  `scm_t_intptr' and `scm_t_uintptr', respectively.
  (SCM_T_SIGNED_BITS_MAX, SCM_T_SIGNED_BITS_MIN, SCM_T_BITS_MAX):
  Likewise.
  (SIZEOF_SCM_T_BITS): Remove.

14 years agoRemove unused, non-prefixed macros.
Ludovic Courtès [Tue, 24 Nov 2009 21:25:49 +0000 (22:25 +0100)]
Remove unused, non-prefixed macros.

* libguile/__scm.h (BIGNUMS, TICKS): Remove.

14 years agoUpdate to Gnulib v0.0-2923-g6575ab5.
Ludovic Courtès [Tue, 24 Nov 2009 21:11:28 +0000 (22:11 +0100)]
Update to Gnulib v0.0-2923-g6575ab5.

14 years agoReally disable thread-local storage on NetBSD 5.0.
Ludovic Courtès [Tue, 24 Nov 2009 21:07:16 +0000 (22:07 +0100)]
Really disable thread-local storage on NetBSD 5.0.

* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Adjust to match actual
  NetBSD 5 triplet, `x86_64-unknown-netbsd5.0.' (note the final dot).

14 years agoFix compilation `--without-threads'.
Ludovic Courtès [Tue, 24 Nov 2009 21:06:08 +0000 (22:06 +0100)]
Fix compilation `--without-threads'.

* configure.ac: For `--without-threads' and `--with-threads=null', set
  `SCM_I_GSC_HAVE_THREAD_STORAGE_CLASS=0'.  This fixes compilation of
  `gen-scmconfig.c' in these cases.

14 years agoUse Gnulib's `duplocale' module.
Ludovic Courtès [Mon, 23 Nov 2009 22:47:20 +0000 (23:47 +0100)]
Use Gnulib's `duplocale' module.

* libguile/i18n.c (scm_make_locale): Simplify global locale handling,
  using duplocale(3) for all kinds of locales.
  (scm_init_i18n): Comment on why we don't just use `LC_GLOBAL_LOCALE'
  for `global_locale_smob'.

* m4/gnulib-cache.m4: Add `duplocale'.

14 years agoUse Gnulib's `locale' module.
Ludovic Courtès [Mon, 23 Nov 2009 21:50:34 +0000 (22:50 +0100)]
Use Gnulib's `locale' module.

* configure.ac: Remove test for <xlocale.h>.

* libguile/i18n.c: Remove conditional <xlocale.h> inclusion on
  `HAVE_XLOCALE_H'.

* m4/gnulib-cache.m4: Add `locale' module.

14 years agoCorrect manual wrt. encoding names.
Ludovic Courtès [Mon, 23 Nov 2009 17:51:25 +0000 (18:51 +0100)]
Correct manual wrt. encoding names.

* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
  Don't suggest `latin1' as a good encoding name since Emacs cannot deal
  with it.

* libguile/read.c (scm_file_encoding): Fix "Emacs" spelling.

14 years agobetter printing of procedures with keyword arguments
Andy Wingo [Fri, 20 Nov 2009 12:12:44 +0000 (13:12 +0100)]
better printing of procedures with keyword arguments

* module/system/vm/program.scm (arguments->lambda-list): Print keyword
  arguments more sensibly.

14 years agofix version-etc for older autoconf
Andy Wingo [Fri, 20 Nov 2009 16:24:40 +0000 (17:24 +0100)]
fix version-etc for older autoconf

* lib/version-etc.c: Don't reference the undefined PACKAGE if
  PACKAGE_URL is undefined. Probably should go upstream.

14 years agoautogen.sh: Don't presume /usr/bin/m4.
Ludovic Courtès [Wed, 18 Nov 2009 14:32:03 +0000 (15:32 +0100)]
autogen.sh: Don't presume /usr/bin/m4.

* autogen.sh: Don't presume /usr/bin/m4.

14 years agoWork around path name length limitations in `socket.test'.
Ludovic Courtès [Wed, 18 Nov 2009 14:28:56 +0000 (15:28 +0100)]
Work around path name length limitations in `socket.test'.

* test-suite/tests/socket.test (%tmpdir, %curdir): New variables.
  Chdir to %TMPDIR.  Switch back to %CURDIR at the end.
  (temp-file-path): Return a base file name, not an absolute path.

14 years agoRemove conflicting definition of $PACKAGE from `GUILE-VERSION'.
Ludovic Courtès [Wed, 18 Nov 2009 13:59:33 +0000 (14:59 +0100)]
Remove conflicting definition of $PACKAGE from `GUILE-VERSION'.

This obviates the need for the previous commit,
53da7372beca90a58b7401a84627815289a53d11.

* GUILE-VERSION (VERSION, PACKAGE): Remove.  The latter was conflicting
  with Automake's definition, which is "guile", not "GNU Guile".

* Makefile.am (distdir): Remove.

* configure.ac: Hardcode the package name passed to `AC_INIT'.
  (pkgdatadir, pkgincludedir, pkglibdir, pkglibexecdir): Remove.

14 years agoFix $(pkgdatadir) & co. so they refer to $(PACKAGE_TARNAME), not $(PACKAGE).
Ludovic Courtès [Wed, 18 Nov 2009 11:13:31 +0000 (12:13 +0100)]
Fix $(pkgdatadir) & co. so they refer to $(PACKAGE_TARNAME), not $(PACKAGE).

This fixes a regression introduced in
4f02b98d0ed4a314916c69a225d7a45dda3f5f8c ("Use Gnulib's
`version-etc-fsf' for `--version' and `--help' output."), which led
$(pkgdatadir) & co. to contain the string "GNU Guile" instead of
"guile".

* configure.ac (pkgdatadir, pkgincludedir, pkglibdir, pkglibexecdir):
  New variables.

14 years agoBump version number for 1.9.5.
Ludovic Courtès [Tue, 17 Nov 2009 22:18:27 +0000 (23:18 +0100)]
Bump version number for 1.9.5.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

14 years agoDon't use `-Werror' by default.
Ludovic Courtès [Tue, 17 Nov 2009 22:31:45 +0000 (23:31 +0100)]
Don't use `-Werror' by default.

* configure.ac (GUILE_ERROR_ON_WARNING): Default to "no".

* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.

* NEWS: Update.

14 years agoFix copyright headers.
Ludovic Courtès [Tue, 17 Nov 2009 21:48:02 +0000 (22:48 +0100)]
Fix copyright headers.

* module/system/vm/debug.scm, module/system/vm/frame.scm,
  module/system/vm/vm.scm: Switch to LGPLv3+.

14 years agoFix stylistic issues revealed by "make syntax-check".
Ludovic Courtès [Tue, 17 Nov 2009 22:07:10 +0000 (23:07 +0100)]
Fix stylistic issues revealed by "make syntax-check".

* libguile/gc-malloc.c (scm_must_free): Remove unnecessary `if' before
  `free ()'.

* libguile/stime.c (scm_localtime, scm_mktime): Likewise.

* libguile/eval.i.c (ceval): Don't cast the result of alloca(3).

* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Likewise.

* test-suite/standalone/test-unwind.c: Likewise.

* libguile/strings.c (scm_i_deprecated_string_chars): Don't end error
  message in period.

14 years agoAdd Gnulib maintainer modules.
Ludovic Courtès [Tue, 17 Nov 2009 22:07:42 +0000 (23:07 +0100)]
Add Gnulib maintainer modules.

* m4/gnulib-cache.m4: Add `announce-gen', `gendocs', `gitlog-to-changelog',
  `gnupload', `gnu-web-doc-update', and `maintainer-makefile'.

* .gnuploadrc, .x-sc_GPL_version, .x-sc_avoid_if_before_free,
  .x-sc_error_message_period, .x-sc_cast_of_alloca_return_value,
  .x-sc_cast_of_argument_to_free, .x-sc_error_message_uppercase,
  .x-sc_error_message_warn_fatal: New files.

14 years agoUse Gnulib's `version-etc-fsf' for `--version' and `--help' output.
Ludovic Courtès [Tue, 17 Nov 2009 21:03:13 +0000 (22:03 +0100)]
Use Gnulib's `version-etc-fsf' for `--version' and `--help' output.

* m4/gnulib-cache.m4: Add `version-etc-fsf'.  Switch to LGPLv3+.

* GUILE-VERSION (PACKAGE): Change to "GNU Guile".

* Makefile.am (distdir): New variable.

* libguile/script.c (scm_shell_usage): Improve formatting.  Use
  `emit_bug_reporting_address ()'.
  (scm_compile_shell_switches): Use `version_etc ()'.

14 years agoBuild the C code with additional GCC warnings.
Ludovic Courtès [Tue, 17 Nov 2009 20:10:41 +0000 (21:10 +0100)]
Build the C code with additional GCC warnings.

* configure.ac (POTENTIAL_GCC_CFLAGS): Add
  `-Wdeclaration-after-statement -Wundef -Wswitch-enum'.

14 years agoRemove references to undefined macros.
Ludovic Courtès [Tue, 17 Nov 2009 22:40:51 +0000 (23:40 +0100)]
Remove references to undefined macros.

The intent is to allow compilation with `-Wundef', which in turn should
make it easier to catch erroneous uses of nonexistent macros.

* libguile/__scm.h: Don't assume `BUILDING_LIBGUILE' is defined.

* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): Remove unneeded CPP
  conditional on `TYPE_MIN == 0'.

* libguile/fports.c: Check for the definition of `HAVE_CHSIZE' and
  `HAVE_FTRUNCATE', not for their value.

* libguile/ports.c: Likewise.

* libguile/numbers.c (guile_ieee_init): Likewise with `HAVE_DINFINITY'
  and `HAVE_DQNAN'.

* test-suite/standalone/test-conversion.c (ieee_init): Likewise.

* libguile/strings.c: Likewise with `SCM_STRING_LENGTH_HISTOGRAM'.

* libguile/strings.h: Likewise.

* libguile/tags.h: Likewise with `HAVE_INTTYPES_H' and `HAVE_STDINT_H'.

* libguile/threads.c: Likewise with `HAVE_PTHREAD_GET_STACKADDR_NP'.

* libguile/vm-engine.c (VM_NAME): Likewise with `VM_CHECK_IP'.

* libguile/gen-scmconfig.c (main): Use "#ifdef HAVE_", not "#if HAVE_".

* libguile/socket.c (scm_setsockopt): Likewise.

14 years agoRemove now unneeded `putenv.c'.
Ludovic Courtès [Tue, 17 Nov 2009 21:48:37 +0000 (22:48 +0100)]
Remove now unneeded `putenv.c'.

* libguile/Makefile.am (EXTRA_libguile_la_SOURCES): Remove `putenv.c'.

* libguile/putenv.c: Remove.

14 years agoRemove `qt/'.
Ludovic Courtès [Tue, 17 Nov 2009 21:56:29 +0000 (22:56 +0100)]
Remove `qt/'.

14 years agoFix C99-style declarations after statements.
Ludovic Courtès [Tue, 17 Nov 2009 00:26:25 +0000 (01:26 +0100)]
Fix C99-style declarations after statements.

* libguile/eval.i.c (ceval): Move declarations before statements.

* libguile/read.c (scm_read_extended_symbol): Likewise.

* libguile/struct.c (scm_make_struct_layout): Likewise.

* libguile/threads.c (fat_mutex_unlock): Likewise.

* libguile/vm-i-system.c (br_if_nargs_ne, br_if_nargs_lt): Likewise.

* libguile/vm.c (make_vm): Likewise.

14 years agoRemove deprecated guardian code.
Ludovic Courtès [Mon, 16 Nov 2009 23:24:32 +0000 (00:24 +0100)]
Remove deprecated guardian code.

* libguile/guardians.c (guardian_apply): Remove `#if ENABLE_DEPRECATED'
  section since it was never compiled in, not even in 1.8.
  (scm_init_guardians): Likewise.

14 years agoUse Gnulib's `warning' module.
Ludovic Courtès [Mon, 16 Nov 2009 22:40:28 +0000 (23:40 +0100)]
Use Gnulib's `warning' module.

* m4/gnulib-cache.m4: Add `warnings'.

* configure.ac: Use `gl_WARN_ADD' to check whether compiler flags are
  supported.

* libguile/Makefile.am (libguile_la_LIBADD): Add $(LTLIBICONV).
  (libguile_la_LDFLAGS): Add $(INET_NTOP_LIB) $(INET_PTON_LIB).

14 years agofold 1.9.5 NEWS items into the main text
Andy Wingo [Tue, 17 Nov 2009 21:04:48 +0000 (22:04 +0100)]
fold 1.9.5 NEWS items into the main text

* NEWS: Fold 1.9.5 things into the main text.

14 years agoUpdate NEWS.
Andy Wingo [Tue, 17 Nov 2009 20:51:56 +0000 (21:51 +0100)]
Update NEWS.

* NEWS: Update for 1.9.5. Still needs these entries to be folded into
  the main section though.

14 years agowith a rest arg, allow for keywords anywhere
Andy Wingo [Mon, 16 Nov 2009 21:32:54 +0000 (22:32 +0100)]
with a rest arg, allow for keywords anywhere

* libguile/vm-i-system.c (br-if-nargs-gt): Fix variable declaration
  placement.
  (bind-kwargs): Patch mostly by Ludovic: it seems that in the mode in
  which we have rest args, the keywords can appear anywhere. Bummer.
  Change to allow for this.

* module/ice-9/optargs.scm (parse-lambda-case): Same, add a
  permissive-keys clause that handles the case in which there's a rest
  argument.

14 years agoSCM_DEBUG fix: Don't apply SCM_CAR to non-pairs when walking argument
Ken Raeburn [Mon, 16 Nov 2009 04:43:17 +0000 (23:43 -0500)]
SCM_DEBUG fix: Don't apply SCM_CAR to non-pairs when walking argument
lists in method cache matching.

* libguile/goops.c (scm_mcache_lookup_cmethod): Don't apply SCM_CAR to
  non-pairs when walking argument lists in method cache matching.
  Don't check for CLASSP or symbol in the car slot, since the end of
  the specifier list is a non-pair.  Update comments to reflect new
  structure of method cache entry.
* module/oops/goops/dispatch.scm: Update comments here too.

14 years agoAdd `iconv_open-solaris.h' to remove dependency on gperf.
Ludovic Courtès [Mon, 16 Nov 2009 13:57:01 +0000 (14:57 +0100)]
Add `iconv_open-solaris.h' to remove dependency on gperf.

* lib/iconv_open-solaris.h: New file.

14 years agoUse Gnulib's `alignof' module.
Ludovic Courtès [Sun, 15 Nov 2009 19:53:21 +0000 (20:53 +0100)]
Use Gnulib's `alignof' module.

* m4/gnulib-cache.m4: Use `alignof'.

* libguile/objcodes.c (scm_c_make_objcode_slice): Use `alignof_type'.

14 years agoDeprecate `inet-ntoa' and `inet-aton'.
Ludovic Courtès [Sun, 15 Nov 2009 19:50:08 +0000 (20:50 +0100)]
Deprecate `inet-ntoa' and `inet-aton'.

Suggested by Bruno Haible.

* libguile/inet_aton.c: Remove.

* libguile/Makefile.am (EXTRA_libguile_la_SOURCES): Remove
  `inet_aton.c'.

* libguile/deprecated.c (scm_inet_aton, scm_inet_ntoa): New functions.

* libguile/deprecated.h: Update accordingly.

* libguile/socket.c (scm_inet_aton, scm_inet_ntoa): Remove.

* doc/ref/posix.texi (Network Address Conversion): Mark `inet-ntoa' and
  `inet-aton' as deprecated.

14 years agoUse Gnulib's `inet_ntop' and `inet_pton' modules.
Ludovic Courtès [Sun, 15 Nov 2009 19:16:40 +0000 (20:16 +0100)]
Use Gnulib's `inet_ntop' and `inet_pton' modules.

* m4/gnulib-cache.m4: Add `inet_ntop' and `inet_pton'.

* configure.ac: Don't check for `inet_ntop' and `inet_pton'.

* libguile/socket.c (scm_inet_pton, scm_inet_ntop): Compile regardless
  of `HAVE_INET_PTON' and `HAVE_INET_NTOP' respectively.

* libguile/filesys.c: Use <stdlib.h> instead of <canonicalize.h>.

14 years agoRe-add an indirection in bytevectors.
Ludovic Courtès [Sun, 15 Nov 2009 18:34:38 +0000 (19:34 +0100)]
Re-add an indirection in bytevectors.

The intent is to allow for mmap(3) bindings and to actually reuse
user-provided buffers in `scm_c_take_bytevector ()'.

* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): Increment.
  (SCM_BYTEVECTOR_CONTENTS): Take the pointer from the second word.
  (SCM_BYTEVECTOR_CONTIGUOUS_P): New macro.
  (SCM_BYTEVECTOR_ELEMENT_TYPE): Adjust to live alongside the CONTIGUOUS
  flag.

* libguile/bytevectors.c (SCM_BYTEVECTOR_SET_CONTENTS,
  SCM_BYTEVECTOR_SET_CONTIGUOUS_P): New macros.
  (SCM_BYTEVECTOR_SET_ELEMENT_TYPE): Adjust.
  (SCM_BYTEVECTOR_TYPED_LENGTH): Properly parenthesize.
  (make_bytevector): Adjust to new bytevector header.
  (make_bytevector_from_buffer): Reuse CONTENTS.
  (scm_c_shrink_bytevector): Differentiate between contiguous and
  non-contiguous bytevectors.

14 years agoRemove unused internal bytevector functions.
Ludovic Courtès [Sun, 15 Nov 2009 18:22:01 +0000 (19:22 +0100)]
Remove unused internal bytevector functions.

* libguile/bytevectors.c (scm_i_make_typed_bytevector,
  scm_c_take_typed_bytevector): Remove.

* libguile/bytevectors.h: Adjust accordingly.

14 years agoRun the GC and retry `open-file' when getting `EMFILE'.
Ludovic Courtès [Sun, 15 Nov 2009 15:55:57 +0000 (16:55 +0100)]
Run the GC and retry `open-file' when getting `EMFILE'.

* libguile/fports.c (scm_open_file): Run the GC and retry when getting
  `EMFILE'.

14 years agoImprove documentation of supported encoding names.
Ludovic Courtès [Sun, 15 Nov 2009 13:46:33 +0000 (14:46 +0100)]
Improve documentation of supported encoding names.

* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
  Mention IANA as the list of supported character encodings.  Thanks to
  Bruno Haible for pointing this out.

* doc/ref/api-io.texi (Ports): Likewise.  Improve documentation of
  `%default-port-encoding'.

14 years agoFix off-by-one error in processing Emacs-style coding declaration.
Ken Raeburn [Sat, 14 Nov 2009 19:53:46 +0000 (14:53 -0500)]
Fix off-by-one error in processing Emacs-style coding declaration.

* libguile/read.c (scm_i_scan_for_encoding): Don't copy the first
  character after the coding declaration into the new string.

14 years agoopcodes for bit twiddling (ash, logand, logior, logxor)
Andy Wingo [Fri, 6 Nov 2009 12:13:39 +0000 (13:13 +0100)]
opcodes for bit twiddling (ash, logand, logior, logxor)

* module/language/tree-il/compile-glil.scm:
* module/language/tree-il/primitives.scm:
* libguile/vm-i-scheme.c (ash, logand, logior, logxor): New opcodes.

14 years agoclass-of has an opcode
Andy Wingo [Fri, 6 Nov 2009 11:40:20 +0000 (12:40 +0100)]
class-of has an opcode

* libguile/vm-i-scheme.c (class-of): New opcode.
* module/language/tree-il/compile-glil.scm:
* module/oop/goops.scm: Compile class-of into an opcode.

14 years agofaster conditionals
Andy Wingo [Fri, 6 Nov 2009 11:13:33 +0000 (12:13 +0100)]
faster conditionals

* module/language/tree-il/compile-glil.scm (flatten): Compile `if'
  statements with `eq?' and `null?', and their `not?' variants, into
  more specific bytecode.

14 years agofix (apply f) -- without the args list
Andy Wingo [Fri, 6 Nov 2009 10:16:54 +0000 (11:16 +0100)]
fix (apply f) -- without the args list

* module/language/tree-il/primitives.scm (apply): Only inline if we
  actually have an argument to apply.

14 years agoRevert "implement #:predicate" and remove predicate from <lambda-case>
Andy Wingo [Thu, 5 Nov 2009 09:22:01 +0000 (10:22 +0100)]
Revert "implement #:predicate" and remove predicate from <lambda-case>

Turns out this was not a very useful idea, and semantically tricky to
boot.

This reverts commit 24bf130fd15afbc8b3a2ccdc50a027f9b6c9e623, and makes
the following additional changes:

* module/ice-9/optargs.scm (parse-lambda-case, let-optional)
  (let-optional*, let-keywords, let-keywords*):
* module/language/tree-il.scm: (<lambda-case>, parse-tree-il)
  (unparse-tree-il, tree-il->scheme, tree-il-fold,
  make-tree-il-folder)
  (post-order!, pre-order!):
* module/language/tree-il/analyze.scm (analyze-lexicals):
* module/language/tree-il/compile-glil.scm (compile-glil):
* module/language/tree-il/inline.scm (inline!): Remove all traces of
  #:predicate from tree-il.

* module/ice-9/psyntax.scm (build-simple-lambda, build-lambda-case)
  (chi-lambda-case): Adapt to tree-il change.
* module/ice-9/psyntax-pp.scm: Regenerated.

* module/language/brainfuck/compile-tree-il.scm (compile-body):
* module/language/ecmascript/compile-tree-il.scm (comp, comp-body):
* test-suite/tests/tree-il.test: Adapt to tree-il change.

* doc/ref/api-procedures.texi (Case-lambda): Remove mention of
  #:predicate.

14 years agoactually set all 8 hashsets in classes
Andy Wingo [Tue, 3 Nov 2009 21:43:29 +0000 (22:43 +0100)]
actually set all 8 hashsets in classes

* libguile/goops.c (prep_hashsets): Actually set all 8 hashsets. Doh...

14 years agoremove goops-local %tag-body
Andy Wingo [Tue, 3 Nov 2009 21:41:59 +0000 (22:41 +0100)]
remove goops-local %tag-body

* libguile/goops.c (scm_sys_tag_body): Remove goops-local hack that is
  no longer necessary.

14 years agoSCM_VALIDATE_VTABLE tweak
Andy Wingo [Tue, 3 Nov 2009 21:33:22 +0000 (22:33 +0100)]
SCM_VALIDATE_VTABLE tweak

* libguile/validate.h (SCM_VALIDATE_VTABLE): Simply call
  scm_struct_vtable_p.

14 years agofix printing-programs bug
Andy Wingo [Tue, 3 Nov 2009 21:32:39 +0000 (22:32 +0100)]
fix printing-programs bug

* module/system/vm/program.scm (write-program): Fix a bug if we couldn't
  get a procedure's arity.

14 years agovalues.c defines a vtable, not a vtable-vtable
Andy Wingo [Tue, 3 Nov 2009 21:28:26 +0000 (22:28 +0100)]
values.c defines a vtable, not a vtable-vtable

* libguile/values.c (scm_init_values): Define a vtable, not a
  "metaclass".

14 years agosrfi-35 properly uses vtable-offset-user
Andy Wingo [Tue, 3 Nov 2009 21:27:34 +0000 (22:27 +0100)]
srfi-35 properly uses vtable-offset-user

* module/srfi/srfi-35.scm (condition-type-id):
  (condition-type-parent, condition-type-all-fields): Don't ref fixed
  struct indices, use vtable-offset-user instead.

14 years agofix a structs.test test
Andy Wingo [Tue, 3 Nov 2009 21:26:46 +0000 (22:26 +0100)]
fix a structs.test test

* test-suite/tests/structs.test ("equal?"): Instantiate vtables, not
  vtable-vtables. "hello" is not a valid vtable layout.

14 years agoremove redundant, unnecessary instance size from struct vtables
Andy Wingo [Sun, 1 Nov 2009 20:09:42 +0000 (21:09 +0100)]
remove redundant, unnecessary instance size from struct vtables

* libguile/struct.h (scm_struct_i_size): Remove this shared field -- I
  mean, the slot is still there, but it's only used for flags.

* libguile/goops.h (SCM_SET_CLASS_INSTANCE_SIZE):
* libguile/goops.c (scm_sys_inherit_magic_x, scm_make_class): Remove
  uses and definition of SCM_SET_CLASS_INSTANCE_SIZE. Light structs used
  it, but you have that info in the layout; and foreign classes used it,
  but that is going away soon anyway :)

14 years agofold objects.[ch] into goops.[ch]
Andy Wingo [Sun, 1 Nov 2009 19:45:02 +0000 (20:45 +0100)]
fold objects.[ch] into goops.[ch]

Remove objects.h #includes as appropriate.

14 years agoremove support for "entities" -- a form of applicable struct
Andy Wingo [Sun, 1 Nov 2009 18:46:27 +0000 (19:46 +0100)]
remove support for "entities" -- a form of applicable struct

Entities were meant to be a form of applicable struct. Unfortunately,
the implementation is intertwingled with generics. Removing them, for
now, will make it possible to cleanly re-add applicable struct support.

* libguile/struct.h (SCM_STRUCTF_ENTITY): Remove.
  (SCM_STRUCTF_GOOPS_HACK): New flag; sigh.
* libguile/struct.c (scm_make_struct): We make "entity" structs if the
  GOOPS_HACK flag is set. This will be fixed when we rework flags and
  remove hidden words.

* libguile/goops.c (scm_class_of): Structs are not applicable, for now
  at least.
  (scm_sys_inherit_magic_x, scm_basic_basic_make_class)
  (scm_sys_allocate_instance, scm_sys_set_object_setter_x):
  (make_struct_class): Adapt for no more entities (and thus no entity
  flag).
  (create_standard_classes): For some reason, generic functions were
  getting the LIGHT flag set, after the ENTITY flag was removed; so for
  now explicitly clear that flag.
* libguile/goops.h (SCM_GENERIC_SETTER, SCM_SET_GENERIC_SETTER): New
  macros.

* libguile/objects.h:
* libguile/objects.c: Remove code for entities.

* libguile/debug.c: (scm_procedure_source): Only work with generics.

* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
  (scm_trampoline_2): Only handle generics.

* libguile/eval.i.c (CEVAL): #ifdef out the pieces about entities.

* libguile/procprop.c (scm_i_procedure_arity): Remove support for
  entities.

* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Remove
  entity support.

14 years agoSCM_GENERIC_METHOD_CACHE macro splits from SCM_ENTITY_PROCEDURE
Andy Wingo [Sat, 31 Oct 2009 11:04:53 +0000 (12:04 +0100)]
SCM_GENERIC_METHOD_CACHE macro splits from SCM_ENTITY_PROCEDURE

* libguile/goops.h (SCM_GENERIC_METHOD_CACHE)
  (SCM_SET_GENERIC_METHOD_CACHE): Two new macros; the same as
  SCM_[SET_]ENTITY_PROCEDURE, but more reflecting the reality of the
  generic hack.

* libguile/eval.i.c:
* libguile/goops.c:
* libguile/objects.c:
* libguile/vm-i-system.c: Use the new macros when it is appropriate to
  do so.

14 years agoremove unused things from object.[ch]
Andy Wingo [Sat, 31 Oct 2009 10:17:12 +0000 (11:17 +0100)]
remove unused things from object.[ch]

* libguile/objects.h:
* libguile/objects.c (scm_object_procedure): Remove, it was only
  compiled with SCM_DEBUG.

* libguile/objects.h:
* libguile/objects.c (scm_make_class_object, scm_make_subclass_object,
  (scm_i_make_class_object, scm_metaclass_standard): Remove also. These
  implemented an undocumented object system, and are totally replaced by
  GOOPS.

14 years agoremove operators
Andy Wingo [Fri, 30 Oct 2009 23:28:43 +0000 (00:28 +0100)]
remove operators

14 years agogeneric dispatch in the vm (sorta)
Andy Wingo [Fri, 30 Oct 2009 23:08:42 +0000 (00:08 +0100)]
generic dispatch in the vm (sorta)

* libguile/vm-i-system.c (call, goto/args, mv-call): Add a case for
  generics, so we can avoid the evaluator in that case. Still have to
  cons up a list -- the real solution comes later.

14 years agoremove unused struct gc chain macros
Andy Wingo [Thu, 29 Oct 2009 08:47:00 +0000 (09:47 +0100)]
remove unused struct gc chain macros

* libguile/struct.h (SCM_STRUCT_GC_CHAIN, SCM_SET_STRUCT_GC_CHAIN):
  Remove, no longer necessary given topological finalization, provided
  by libGC.

14 years agode-inline goops dispatch from the evaluator
Andy Wingo [Fri, 30 Oct 2009 21:21:29 +0000 (22:21 +0100)]
de-inline goops dispatch from the evaluator

* libguile/eval.i.c: De-inline goops dispatch from the evaluator. Part
  of a refactor.

14 years agoadd quasisyntax
Andreas Rottmann [Sat, 14 Nov 2009 16:25:12 +0000 (17:25 +0100)]
add quasisyntax

* module/Makefile.am:
* module/ice-9/boot-9.scm:
* module/ice-9/quasisyntax.scm: Add quasisyntax. Implementation by Andre
  van Tonder, patch by Andreas Rottmann.
* test-suite/tests/srfi-10.test: Hack to remove srfi-10's clobbering of
  #,.
* test-suite/tests/syncase.test: Add a quasisyntax test.

14 years agoadd include-from-path
Andy Wingo [Sat, 14 Nov 2009 16:04:28 +0000 (17:04 +0100)]
add include-from-path

* module/ice-9/psyntax.scm (include-from-path): New syntax. Searches the
  load path for a file, and includes it.

14 years agopsyntax.scm uses #' shorthand for (syntax ...)
Andy Wingo [Sat, 14 Nov 2009 15:53:36 +0000 (16:53 +0100)]
psyntax.scm uses #' shorthand for (syntax ...)

* module/ice-9/psyntax.scm: Convert to use #'.

14 years agoAdd currently failing tests for optargs.
Ludovic Courtès [Sat, 14 Nov 2009 15:52:48 +0000 (16:52 +0100)]
Add currently failing tests for optargs.

* test-suite/tests/optargs.test (exception:unrecognized-keyword,
  exception:extraneous-arguments): New variables.
  ("define*")["extraneous arguments", "unrecognized keyword", "rest
  given before keywords"]: New tests.

14 years agoExplicitly disable TLS on NetBSD 5.0.
Ludovic Courtès [Sat, 14 Nov 2009 15:50:38 +0000 (16:50 +0100)]
Explicitly disable TLS on NetBSD 5.0.

* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Explicitly disable TLS on
  NetBSD 5.0.

14 years agoHave `scm_scan_for_encoding ()' use GC-managed memory.
Ludovic Courtès [Sat, 14 Nov 2009 15:27:28 +0000 (16:27 +0100)]
Have `scm_scan_for_encoding ()' use GC-managed memory.

* libguile/read.c (scm_scan_for_encoding): Rename to ...
  (scm_i_scan_for_encoding): ... this; update callers.  Use
  `scm_gc_strndup ()' instead of `scm_malloc ()'.

* libguile/read.h: Update accordingly.

* libguile/load.c (scm_primitive_load): Don't call free(3) on the value
  returned by `scm_i_scan_for_encoding ()'.

14 years agoReplace `setbinary' by a public `%default-port-encoding' fluid.
Ludovic Courtès [Sat, 14 Nov 2009 15:14:20 +0000 (16:14 +0100)]
Replace `setbinary' by a public `%default-port-encoding' fluid.

* doc/ref/api-evaluation.texi (Character Encoding of Source Files): Add
  reference to the "Ports" node.

* doc/ref/api-io.texi (Ports): Document `%default-port-encoding'.

* libguile/ports.c (scm_port_encoding_var): Rename to...
  (default_port_encoding_var): ... this; update callers.  Make `static'.

* libguile/posix.c (scm_setbinary): Remove.

* libguile/posix.h: Adjust accordingly.

* test-suite/tests/numbers.test: Remove unneeded `setbinary' call.

* test-suite/tests/ports.test: Replace `setbinary' call by equivalent
  `%default-port-encoding' mutation and `set-port-encoding!' calls.

* test-suite/tests/r6rs-ports.test: Replace `setbinary' call by
  equivalent `%default-port-encoding' mutation.

14 years agoExplicitly require `sed'.
Ludovic Courtès [Sat, 14 Nov 2009 10:42:14 +0000 (11:42 +0100)]
Explicitly require `sed'.

* configure.ac: Use `AC_PROG_SED'.

14 years agofix bugs in ecmascript compiler
Andy Wingo [Sat, 14 Nov 2009 12:34:40 +0000 (13:34 +0100)]
fix bugs in ecmascript compiler

* module/language/ecmascript/compile-tree-il.scm: Fix a number of bugs,
  fallen out from the ghil->tree-il conversion.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add a hack
  for "return" for javascript. Scheme shouldn't see this because it's
  not an "interesting primitive".

14 years agofix scoping in let-keywords
Andy Wingo [Sat, 14 Nov 2009 12:26:46 +0000 (13:26 +0100)]
fix scoping in let-keywords

* module/ice-9/optargs.scm (let-keywords): I thought that I had the
  scoping right here, but I didn't. Make sure that the lambda formals
  for the initializers are new, fresh identifiers, so that let scoping
  works appropriately.

14 years agofix bug in string comparison
Andy Wingo [Sat, 14 Nov 2009 12:25:00 +0000 (13:25 +0100)]
fix bug in string comparison

* libguile/srfi-13.c (compare_strings): Switch the "longer" and
  "shorter" arguments. All the callers of this function assumed that
  shorter came first. Fixes (string<? "abc" "abcd").

14 years agoImprove the printer of SRFI-35 error conditions.
Ludovic Courtès [Tue, 10 Nov 2009 21:15:21 +0000 (22:15 +0100)]
Improve the printer of SRFI-35 error conditions.

* module/srfi/srfi-35.scm (print-condition): Print the name and value of
  each field.

14 years agoAdd support for multiple arities in `arity-mismatch-analysis'.
Ludovic Courtès [Sun, 8 Nov 2009 16:53:14 +0000 (17:53 +0100)]
Add support for multiple arities in `arity-mismatch-analysis'.

* module/language/tree-il/analyze.scm (validate-arity)[arity]: Rename
  to...
  [arities]: ... this.  Return all the arities of PROC.
  Update caller accordingly.

* test-suite/tests/tree-il.test ("warnings")["arity
  mismatch"]("case-lambda", "case-lambda with wrong number of
  arguments", "case-lambda*", "case-lambda* with wrong arguments"): New
  tests.

14 years agoUpdate `.gitignore'.
Ludovic Courtès [Sun, 8 Nov 2009 00:15:23 +0000 (01:15 +0100)]
Update `.gitignore'.

14 years agoFix C99-style comments.
Ludovic Courtès [Sun, 8 Nov 2009 00:13:46 +0000 (01:13 +0100)]
Fix C99-style comments.

* libguile/generalized-vectors.c, libguile/programs.c, libguile/vm.c:
  Replace C99-style comments by plain old C89 comments.

14 years agoCompile with `-Warity-mismatch'.
Ludovic Courtès [Sun, 8 Nov 2009 00:12:35 +0000 (01:12 +0100)]
Compile with `-Warity-mismatch'.

* am/guilec (GUILE_WARNINGS): New variable; add `-Warity-mismatch'.
  (.scm.go): Use it.

14 years agoAdd tests for `unbound-variable-analysis'.
Ludovic Courtès [Sun, 8 Nov 2009 00:11:19 +0000 (01:11 +0100)]
Add tests for `unbound-variable-analysis'.

* test-suite/tests/tree-il.test ("warnings")["unbound
  variable"]("optional arguments are visible", "keyword arguments are
  visible"): New tests.

14 years agoFix optional argument handling in `unused-variable-analysis'.
Ludovic Courtès [Sun, 8 Nov 2009 00:08:54 +0000 (01:08 +0100)]
Fix optional argument handling in `unused-variable-analysis'.

* module/language/tree-il/analyze.scm (unused-variable-analysis): Fix
  optional argument handling in <lambda-case>.

14 years agoAdd support for keyword arguments in `arity-mismatch-analysis'.
Ludovic Courtès [Sun, 8 Nov 2009 00:02:08 +0000 (01:02 +0100)]
Add support for keyword arguments in `arity-mismatch-analysis'.

* module/language/tree-il/analyze.scm
  (validate-arity)[filter-keyword-args]: New procedure.
  [arity]: Get accurate arity for programs, return ALLOW-OTHER-KEYS? as
  an additional value.
  Update to `arity' change; use `filter-keyword-args'.

* test-suite/tests/tree-il.test ("warnings")["arity mismatch"]("keyword
  not passed and quiet", "keyword passed and quiet", "keyword passed to
  global and quiet", "extra keyword", "extra keywords allowed"): New
  tests.

14 years agoFix typos leading to wrong argument counts.
Ludovic Courtès [Sat, 7 Nov 2009 18:24:49 +0000 (19:24 +0100)]
Fix typos leading to wrong argument counts.

* module/ice-9/channel.scm (eval): Fix number of arguments to
  `guile:eval'.

* module/oop/goops/save.scm (write-readably): Fix number of arguments to
  `write-array'.

* module/srfi/srfi-19.scm (priv:char->int): Fix number of arguments to
  `priv:time-error'.