bpt/guile.git
14 years agoformally deprecate trampolines
Andy Wingo [Fri, 27 Nov 2009 19:36:09 +0000 (20:36 +0100)]
formally deprecate trampolines

* libguile/eval.c:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_trampoline_0, scm_trampoline_1)
  (scm_trampoline_2): Actually deprecate trampolines.

* srfi/srfi-1.c: Fix all trampoline uses in srfi-1.c.

14 years agoremove uses of trampolines within guile itself
Andy Wingo [Fri, 27 Nov 2009 17:13:59 +0000 (18:13 +0100)]
remove uses of trampolines within guile itself

* libguile/eval.c (scm_map, scm_for_each)
* libguile/hashtab.c (scm_hash_for_each_handle)
* libguile/list.c (scm_filter, scm_filter_x)
* libguile/quicksort.i.c:
* libguile/sort.c (scm_restricted_vector_sort_x, scm_sorted_p)
  (scm_merge, scm_merge_list_x, scm_merge_x)
  (scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x)
  (scm_merge_vector_step, scm_stable_sort_x, scm_sort_list_x)
  (scm_sort_list)nn
* libguile/srfi-13.c (scm_string_any, scm_string_every)
  (scm_string_tabulate, scm_string_trim, string_trim_right)
  (scm_string_trim_both, scm_string_index, scm_string_index_right)
  (scm_string_skip, scm_string_skip_right, scm_string_count)
  (scm_string_map, scm_string_map_x, scm_string_for_each)
  (scm_string_for_each_index, scm_string_filter, scm_string_delete):
  Remove uses of trampolines.

14 years agogut the backtrace implementation for memoized code
Andy Wingo [Fri, 27 Nov 2009 16:35:37 +0000 (17:35 +0100)]
gut the backtrace implementation for memoized code

* libguile/backtrace.c (display_header, display_expression)
  (display_error_body, display_backtrace_get_file_line, display_frame):
  Gut the implementation for memoized code, as memoized code as it is
  currently understood is going away.

14 years agoremove some deprecated things, undeprecate scm_the_root_module()
Andy Wingo [Fri, 27 Nov 2009 16:24:12 +0000 (17:24 +0100)]
remove some deprecated things, undeprecate scm_the_root_module()

* libguile/deprecated.h
* libguile/deprecated.c (SCM_ILOC00, SCM_IDINC, SCM_IDSTMSK)
  (scm_s_expression, scm_s_test, scm_s_body, scm_s_bindings)
  (scm_s_variable, scm_s_clauses, scm_s_formals, SCM_EVALIM2)
  (SCM_EVALIM, SCM_XEVAL, SCM_XEVALCAR): Remove these macros and
  constants, deprecated in 2003.
  (scm_the_root_module): Undeprecate, it's actually a useful function,
  that other parts of the code use.

* libguile/modules.h (scm_the_root_module): Undeprecated.
* libguile/modules.c (scm_the_root_module): Rename from
  the_root_module. Use it in the rest of this file.

14 years agotweak to eval.c
Andy Wingo [Thu, 20 Aug 2009 23:17:32 +0000 (01:17 +0200)]
tweak to eval.c

* libguile/eval.c (eval_letrec_inits): Rename from ceval_letrec_inits.
  Caller changed.

14 years agoeval.i.c -> eval.c
Andy Wingo [Thu, 20 Aug 2009 23:14:57 +0000 (01:14 +0200)]
eval.i.c -> eval.c

* libguile/Makefile.am:
* libguile/eval.i.c: Remove eval.i.c.

* libguile/eval.c: Fold eval.i.c's contents into eval.c.

14 years agomore ceval excision
Andy Wingo [Thu, 20 Aug 2009 23:06:00 +0000 (01:06 +0200)]
more ceval excision

* libguile/eval.c:
* libguile/eval.i.c: Rename deval to eval. Substitute in some
  preprocessor macros.

14 years agoremove code from eval.i.c that was only for CEVAL.
Andy Wingo [Thu, 20 Aug 2009 23:00:28 +0000 (01:00 +0200)]
remove code from eval.i.c that was only for CEVAL.

* libguile/eval.i.c: Remove CEVAL-only code.

14 years agoDon't double-include eval.i.c -- let's only build deval.
Andy Wingo [Thu, 20 Aug 2009 22:54:34 +0000 (00:54 +0200)]
Don't double-include eval.i.c -- let's only build deval.

* libguile/eval.c (SCM_I_XEVAL, SCM_I_XEVALCAR): No more debug_p args,
  we are always debugging. Adapt all callers.
  (ceval_letrec_inits): For some reason this function is used by deval.
  No idea why. Pull it out here.

* libguile/eval.i.c (SCM_APPLY): scm_dapply is scm_apply.

14 years agogut trampolines
Andy Wingo [Thu, 20 Aug 2009 22:38:48 +0000 (00:38 +0200)]
gut trampolines

* libguile/eval.c: Gut the trampoline implementation. We'll be doing
  much more clever things here that will obviate the need for the
  procedure arg of map and for-each to be allocated in many cases...
  trampolines were a noble attempt at optimizing in the wrong place.

* srfi/srfi-1.c (scm_srfi1_lset_difference_x): Validate that we get a
  proc, because the trampoline won't do it for us.

* test-suite/tests/sort.test ("sort"):
* test-suite/tests/srfi-1.test ("count", "fold", "list-index"):
  Change expected exceptions, due to trampoline functions not doing any
  computation.

14 years agoexpand out named let to letrec in the eval case
Andy Wingo [Thu, 20 Aug 2009 22:37:39 +0000 (00:37 +0200)]
expand out named let to letrec in the eval case

* module/ice-9/psyntax.scm: In the eval case, expand out named let to
  letrec.
* module/ice-9/psyntax-pp.scm: Regenerated.

14 years agoMake `SCM' type definition acceptable for C++ compilers.
Ludovic Courtès [Sun, 29 Nov 2009 15:45:38 +0000 (16:45 +0100)]
Make `SCM' type definition acceptable for C++ compilers.

* libguile/tags.h (SCM) [SCM_DEBUG_TYPING_STRICTNESS == 1]: Use a named
  struct to avoid errors from C++ compilers such as "error: non-local
  function ‘<anonymous struct>* foo(<anonymous struct>*)’ uses anonymous
  type".  This fixes a regression introduced in
  c6054feaf03f8bde236f5e45a946f38827074923 ("Add support for static
  allocation of cells, strings and stringbufs.").  Reported by Linas
  Vepstas <linasvepstas@gmail.com>.

14 years agoRemove remaining uses of discouraged constructs, really.
Ludovic Courtès [Sat, 28 Nov 2009 21:52:16 +0000 (22:52 +0100)]
Remove remaining uses of discouraged constructs, really.

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

14 years agoRemove remaining uses of discouraged constructs.
Ludovic Courtès [Sat, 28 Nov 2009 14:11:31 +0000 (15:11 +0100)]
Remove remaining uses of discouraged constructs.

* libguile/frames.c, libguile/instructions.c, libguile/objcodes.c,
  libguile/programs.c, libguile/throw.c, libguile/vm-i-scheme.c,
  libguile/vm.c:  Replace uses of discouraged constructs by their
  current counterparts.

14 years agoDisable encoding scanning on non-seekable file ports.
Ludovic Courtès [Fri, 27 Nov 2009 16:00:51 +0000 (17:00 +0100)]
Disable encoding scanning on non-seekable file ports.

* libguile/read.c (scm_i_scan_for_encoding): Don't attempt to scan
  non-seekable file ports.

14 years agoheader tidyings
Andy Wingo [Wed, 25 Nov 2009 23:13:53 +0000 (00:13 +0100)]
header tidyings

* libguile/goops.h:
* libguile/struct.h: c-backslash-region some vars.

14 years agobrace placement fixes
Andy Wingo [Wed, 25 Nov 2009 23:12:12 +0000 (00:12 +0100)]
brace placement fixes

* libguile/goops.c (scm_sys_allocate_instance):
* libguile/vm-i-loader.c (load-wide-string): Fix some brace placements.

14 years agopush goops compile delay out to 30 invocations, for great justice
Andy Wingo [Fri, 20 Nov 2009 16:25:13 +0000 (17:25 +0100)]
push goops compile delay out to 30 invocations, for great justice

* module/oop/goops/dispatch.scm (timer-init): Init to 30 for faster
  goops load time.

14 years agogeneric method cache begone
Andy Wingo [Fri, 20 Nov 2009 12:42:13 +0000 (13:42 +0100)]
generic method cache begone

* libguile/goops.h (SCM_GENERIC_METHOD_CACHE)
  (SCM_SET_GENERIC_METHOD_CACHE, scm_si_generic_cache)
* libguile/goops.c (create_standard_classes): Remove slot for generic
  method cache. Yay!

14 years agoremove code that manages the method cache
Andy Wingo [Fri, 20 Nov 2009 12:31:07 +0000 (13:31 +0100)]
remove code that manages the method cache

* libguile/goops.h (SCM_MCACHE_N_SPECIALIZED)
  (SCM_SET_MCACHE_N_SPECIALIZED, SCM_INITIAL_MCACHE_SIZE)
  (scm_make_method_cache, scm_memoize_method, scm_mcache_lookup_cmethod)
  (scm_mcache_compute_cmethod):
* libguile/goops.c: Remove these procedures which managed the method
  cache. There's still a slot there but it's not initialized. The method
  cache is no longer necessary.

* module/oop/goops/dispatch.scm (memoize-method!): Change to not take a
  "cache" argument.

* libguile/eval.i.c:
* libguile/vm-i-system.c: Remove dispatch via the method cache.

14 years agoremove method cache management code from (oop goops dispatch)
Andy Wingo [Fri, 20 Nov 2009 12:18:07 +0000 (13:18 +0100)]
remove method cache management code from (oop goops dispatch)

* module/oop/goops/dispatch.scm: Remove old method cache things.

14 years agogenerics now dispatch as applicable structs
Andy Wingo [Fri, 20 Nov 2009 12:11:52 +0000 (13:11 +0100)]
generics now dispatch as applicable structs

* libguile/eval.i.c (CEVAL, SCM_APPLY): Dispatch applicable structs
  before pure generics. In practice what this means is that we never hit
  the mcache case, because all pure generics are applicable structs.
  We're moving over to having generics dispatch themselves. Also, they
  don't prepend the struct as an arg; in order to have that effect, the
  user has closures.

* libguile/goops.c (scm_apply_generic, scm_call_generic_0):
  (scm_call_generic_1, scm_call_generic_2, scm_call_generic_3): Dispatch
  directly to the struct procedures.
  (scm_var_make_extended_generic): Remove a duplicate definition for
  scm_var_make_extended_generic.
  (create_standard_classes): Mark all instances of
  <applicable-struct-class> (themselves classes) as applicable classes.
  Meaning: generics are now applicable structs.

* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT): The hashsets are actually
  uw slots -- or at least, making subclasses maps the int slots to be uw
  slots

* libguile/vm-i-system.c (call, goto/args, mv-call): Dispatch applicable
  structs in the VM.

* module/oop/goops/dispatch.scm (emit-linear-dispatch): Fix bug in the
  non-rest cache miss case.
  (delayed-compile): Rework to avoid fluids.
  (cache-dispatch): Don't call `equal?', it causes bootstrapping
  problems with the primitive-generic equal?. Using our own version is
  faster anyway.

14 years agomake sure that when equal? is extended, that the generic has a method
Andy Wingo [Sun, 8 Nov 2009 10:49:06 +0000 (11:49 +0100)]
make sure that when equal? is extended, that the generic has a method

* libguile/goops.h:
* libguile/goops.c (scm_set_primitive_generic_x): New function, for now
  local to the goops module.

* module/oop/goops.scm (equal?): Make sure that when equal? is extended,
  that the generic already has a default method.

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