bpt/guile.git
9 years ago32-way branching in intmap.scm, not 16-way
Andy Wingo [Tue, 31 Mar 2015 10:21:47 +0000 (12:21 +0200)]
32-way branching in intmap.scm, not 16-way

* module/language/cps/intmap.scm (*branch-bits*): Switch to 32-way
  branching.  Marginally faster on lookup, and creation costs can be
  amortized via using the transient interface.  Marginal speedup for
  assembler.scm compilation.

9 years agoIntset-next micro-optimizations
Andy Wingo [Tue, 31 Mar 2015 10:11:22 +0000 (12:11 +0200)]
Intset-next micro-optimizations

* module/language/cps/intset.scm (intset-next): Micro-optimizations.

9 years agoAdd intset-fold, intset-fold2
Andy Wingo [Wed, 1 Apr 2015 08:45:53 +0000 (10:45 +0200)]
Add intset-fold, intset-fold2

* module/language/cps/intset.scm (intset-fold, intset-fold2): New
  functions.

9 years agoAdd intmap-fold.
Andy Wingo [Wed, 1 Apr 2015 08:45:31 +0000 (10:45 +0200)]
Add intmap-fold.

* module/language/cps/intmap.scm (intmap-fold): New function.

9 years agoAdd intmap-prev
Andy Wingo [Fri, 27 Mar 2015 09:34:40 +0000 (10:34 +0100)]
Add intmap-prev

* module/language/cps/intmap.scm (intmap-next): Starting index is
  optional.
  (intmap-prev): New function.

9 years agoDefault "meet" operator is meet-error for intmap
Andy Wingo [Thu, 26 Mar 2015 12:32:46 +0000 (13:32 +0100)]
Default "meet" operator is meet-error for intmap

* module/language/cps/intmap.scm (meet-error): New helper.
  (intmap-add, intmap-union, intmap-intersect): The "meet" argument is
  optional and defaults to meet-error.

9 years agoRemove "free" field of $fun
Andy Wingo [Thu, 26 Mar 2015 13:10:09 +0000 (14:10 +0100)]
Remove "free" field of $fun

* module/language/cps.scm ($fun): Remove unused "free" field.
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/constructors.scm:
* module/language/cps/contification.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/prune-bailouts.scm:
* module/language/cps/prune-top-level-scopes.scm:
* module/language/cps/renumber.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/type-fold.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Adapt all callers.

9 years agoReplace $letrec with $rec
Andy Wingo [Wed, 1 Apr 2015 07:51:13 +0000 (09:51 +0200)]
Replace $letrec with $rec

* module/language/cps.scm ($rec): Replace $letrec with $rec, which is an
  expression, not a term.  This means that the names bound by the letrec
  appear twice: once in the $rec term, and once in the continuation.
  This is not very elegant, but the situation is better than it was
  before.  Adapt all callers.

* doc/ref/compiler.texi (CPS in Guile): Incomplete documentation
  updates.  I'll update these later when the IL settles down.

9 years agoPrecise range inference on <, <=, >=, > branches
Andy Wingo [Tue, 31 Mar 2015 09:13:01 +0000 (11:13 +0200)]
Precise range inference on <, <=, >=, > branches

* module/language/cps/types.scm (restricted-comparison-ranges): New
  helper.
  (define-comparison-inferrer): New helper.
  (<, <=, >=, >): Infer ranges precisely.

9 years agoFix intmap bug for maps with only one element
Andy Wingo [Fri, 27 Mar 2015 12:40:23 +0000 (13:40 +0100)]
Fix intmap bug for maps with only one element

* module/language/cps/intmap.scm (intmap-ref): Fix bug referencing
  values when there is only one value in the map.

9 years agoelf: Add missing argument in 'elf-segment'.
Ludovic Courtès [Mon, 30 Mar 2015 13:19:58 +0000 (15:19 +0200)]
elf: Add missing argument in 'elf-segment'.

* module/system/vm/elf.scm (elf-segment): Add missing argument N.

9 years agoOnly lazily compile where profitable
Andy Wingo [Thu, 12 Mar 2015 13:48:03 +0000 (14:48 +0100)]
Only lazily compile where profitable

* module/ice-9/eval.scm (primitive-eval): Only lazily compile box-ref on
  toplevel variables; otherwise compile eagerly to avoid the
  indirection.

9 years agoOptimize branches in the evaluator
Andy Wingo [Thu, 12 Mar 2015 13:26:24 +0000 (14:26 +0100)]
Optimize branches in the evaluator

* module/ice-9/eval.scm (primitive-eval): Factor out primitive=?
  helper.  Simplify compile-top-call.  Add compile-top-branch for
  primcall branches, so the compiler can see the specialized branch
  operator.

9 years agoPrimcall inlining in eval.scm, lazy function body compilation
Andy Wingo [Thu, 12 Mar 2015 13:06:15 +0000 (14:06 +0100)]
Primcall inlining in eval.scm, lazy function body compilation

* module/ice-9/eval.scm (primitive-eval): Lazily compile lambda bodies.
  Special-case calls to top-level or module variables, and recognize
  some of those calls as primcalls.  In that case, emit closures with
  the primcalls.

9 years agoRemove unused "nargs" field of memoized call expressions
Andy Wingo [Thu, 12 Mar 2015 07:37:04 +0000 (08:37 +0100)]
Remove unused "nargs" field of memoized call expressions

* libguile/eval.c (eval):
* libguile/memoize.c (MAKMEMO_CALL, memoize, unmemoize):
* module/ice-9/eval.scm (primitive-eval): Remove "nargs" field from
  memoized call expressions, and adapt callers.

9 years agoMarginal bootstrap memory improvements
Andy Wingo [Thu, 12 Mar 2015 07:20:58 +0000 (08:20 +0100)]
Marginal bootstrap memory improvements

* module/language/cps/compile-bytecode.scm (optimize, compile-bytecode):
  Marginally improve bootstrap memory usage by not retaining stale
  copies of already-rewritten terms.

9 years agoRemove $void CPS expression type
Andy Wingo [Wed, 11 Mar 2015 20:51:33 +0000 (21:51 +0100)]
Remove $void CPS expression type

* module/language/cps.scm: Remove the $void expression type, replaced by
  $const of the unspecified value.
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/renumber.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/types.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Update callers.

9 years agoAdapt GDB integration to newest patches
Andy Wingo [Mon, 9 Mar 2015 12:45:24 +0000 (13:45 +0100)]
Adapt GDB integration to newest patches

* libguile/libguile-2.2-gdb.scm (vm-frame-function-name): Don't default
  to the address, as we will have better identifying info via the file
  name.
  (vm-frame-source): New helper.
  (compile-time-cond): For some reason "else" matching wasn't working;
  punt and use expressions.
  (snarfy-frame-decorator): Rename from decorator, and adapt to new
  version of Guile frame filter patch.
  (vm-frame-filter): Adapt to frame filter changes, and fill in source
  info.

9 years agoRe-implement (ice-9 streams) in terms of (srfi srfi-41)
Andy Wingo [Thu, 5 Mar 2015 08:44:53 +0000 (09:44 +0100)]
Re-implement (ice-9 streams) in terms of (srfi srfi-41)

* module/ice-9/streams.scm: Re-implement in terms of SRFI-41.  Passes
  tests.

9 years agobuild: Use pipe symbol instead of comma for substitutions.
Mark H Weaver [Sat, 7 Mar 2015 04:56:14 +0000 (23:56 -0500)]
build: Use pipe symbol instead of comma for substitutions.

* meta/Makefile.am (substitute): Use pipe symbol instead of comma for
  substitutions.

9 years agoNon-vector 1D arrays print as #1()
Daniel Llorens [Wed, 18 Feb 2015 08:32:30 +0000 (09:32 +0100)]
Non-vector 1D arrays print as #1()

* libguile/arrays.c (scm_i_print_array): Print the dimension whenever
  the array is a true scm_tc7_array.

* test-suite/tests/arrays.test: Check that non-vector 1D arrays print as
  expected.

9 years agoStruct and array GDB pretty printers hint as arrays
Andy Wingo [Tue, 17 Feb 2015 10:53:03 +0000 (11:53 +0100)]
Struct and array GDB pretty printers hint as arrays

* libguile/libguile-2.2-gdb.scm (make-scm-pretty-printer-worker):
  (%scm-pretty-printer): Refactor to avoid printing all struct / array
  fields by hinting these as arrays.  The resulting print is not as
  faithful to the original data, but that's probably OK.

9 years agoGDB support: add frame annotators and filters
Andy Wingo [Tue, 17 Feb 2015 10:02:52 +0000 (11:02 +0100)]
GDB support: add frame annotators and filters

These features depend on a patch to GDB that has not been merged yet.
If GDB doesn't support the annotator/filter interface, the code have no
effect.

* libguile/libguile-2.2-gdb.scm (compile-time-cond): New helper.
  (snarfy-frame-annotator): Simple annotator that gives subr names for
  snarfed gsubrs.
  (vm-frame-filter): New filter that interleaves Scheme frames with C
  frames on the stack when the user asks for a backtrace.

9 years agoDe-bitrot libguile-2.2-gdb.scm
Andy Wingo [Tue, 17 Feb 2015 10:00:21 +0000 (11:00 +0100)]
De-bitrot libguile-2.2-gdb.scm

* libguile/libguile-2.2-gdb.scm: Update to work with Guile 2.2 stacks.
  Represent the VM stack as a SRFI-41 stream, which will work better
  with the frame filter interface.  Add support for getting the vm
  frame's function name, if possible.

9 years ago(system base types) knows about variables
Andy Wingo [Tue, 17 Feb 2015 09:58:29 +0000 (10:58 +0100)]
(system base types) knows about variables

* module/system/base/types.scm (%tc7-variable): New tc7.
  (cell->object): Handle tc7-variable.

* test-suite/tests/types.test ("opaque objects"): Add a test.

9 years agoFix infinite loop in expander
Andy Wingo [Fri, 13 Feb 2015 15:40:46 +0000 (16:40 +0100)]
Fix infinite loop in expander

* module/ice-9/psyntax.scm (resolve-identifier): There is a case where a
  syntax object can resolve to itself.  Prevent an infinite loop in that
  case by continuing to resolve by name.

* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syncase.test ("infinite loop bug"): Add a test.

9 years agoAdd `scm_smob_type_class()'.
Andy Wingo [Tue, 10 Feb 2015 13:35:35 +0000 (14:35 +0100)]
Add `scm_smob_type_class()'.

* libguile/smob.h:
* libguile/smob.c (scm_smob_type_class): New function, to access the
  GOOPS class for a SMOB type.

9 years agoNEWS and doc updates
Andy Wingo [Mon, 9 Feb 2015 21:43:20 +0000 (22:43 +0100)]
NEWS and doc updates

* doc/ref/vm.texi: Update for new instructions.
* doc/ref/web.texi: Update for URI-reference support.
* NEWS: Update.

9 years agoDocument support for URI references.
Andy Wingo [Sun, 8 Feb 2015 12:12:27 +0000 (13:12 +0100)]
Document support for URI references.

* doc/ref/web.texi (URIs): Update for URI reference changes.

9 years agoReify bytevector? in the correct module
Andy Wingo [Fri, 6 Feb 2015 14:13:32 +0000 (15:13 +0100)]
Reify bytevector? in the correct module

* module/language/cps/reify-primitives.scm (primitive-module): Reify
  bytevector? in the correct module.  Thanks to Nala Ginrut for the
  report.

9 years agoAdd #:static-slot-allocation?
Andy Wingo [Fri, 6 Feb 2015 12:25:17 +0000 (13:25 +0100)]
Add #:static-slot-allocation?

* libguile/goops.h (SCM_VTABLE_FLAG_GOOPS_STATIC): Reserve the fourth
  GOOPS flag to indicate that a class has static slot allocation.

* libguile/goops.c (scm_init_goops_builtins): Define
  vtable-flag-goops-static for goops.scm.

* module/oop/goops.scm (class-has-statically-allocated-slots?): New
  helper.
  (build-slots-list): Instead of the ad-hoc checks for <class> or
  <slot>, use the new helper.
  (initialize): Accept #:static-slot-allocation? keyword.

* module/system/foreign-object.scm (make-foreign-object-type): Declare
  foreign object classes as having static slot allocation.

* test-suite/tests/goops.test ("static slot allocation"): Add tests.

9 years agoFix foreign objects for getter method change
Andy Wingo [Fri, 6 Feb 2015 11:27:56 +0000 (12:27 +0100)]
Fix foreign objects for getter method change

* module/system/foreign-object.scm: Fix getters after change to make
  <accessor-method> instances only apply to their precise specializer
  types.

9 years agoMerge remote-tracking branch 'origin/stable-2.0'
Andy Wingo [Mon, 26 Jan 2015 17:13:38 +0000 (18:13 +0100)]
Merge remote-tracking branch 'origin/stable-2.0'

Conflicts:
libguile/goops.c
libguile/vm-engine.h
module/oop/goops.scm
module/oop/goops/compile.scm
module/oop/goops/dispatch.scm
test-suite/tests/goops.test

9 years agoAccessor methods only apply to subclasses with their slot
Andy Wingo [Mon, 26 Jan 2015 16:54:26 +0000 (17:54 +0100)]
Accessor methods only apply to subclasses with their slot

* libguile/goops.c (is_accessor_method, scm_compute_applicable_methods):
  Fix regression from 51f66c912078a25ab0380c8fc070abb73d178d98 (2009).
  Accessor methods are added on each subclass on which the slot is
  present; therefore if a subclass doesn't have a method, then the
  methods doesn't apply.  Truly fixes #17355, unlike
  583a23bf104c84d9617222856e188f3f3af4934d.

* module/oop/goops.scm (compute-cmethod, compute-getter-method)
  (compute-setter-method): Revert earlier changes.

* test-suite/tests/goops.test ("accessor slots"): Update for new
  expectations, in agreement with Guile 1.8.

9 years agoFix verify-cps
Andy Wingo [Sun, 25 Jan 2015 10:39:42 +0000 (11:39 +0100)]
Fix verify-cps

* module/language/cps/verify.scm (verify-cps): Fix.  Thanks to Steven
  H. Margolis for the note.  Fixes bug #19389.

9 years agoFix accessor struct field inlining
Andy Wingo [Sat, 24 Jan 2015 18:22:47 +0000 (19:22 +0100)]
Fix accessor struct field inlining

* module/oop/goops/compile.scm: Inline into goops.scm, leaving a
  compatible interface stub behind.

* module/oop/goops/dispatch.scm: Don't import (oop goops compile), to
  break circularities.

* module/oop/goops.scm: Move (oop goops util) include up to the top, and
  import (ice-9 match).
  (compute-cmethod): Move here from compile.scm.  Add a special case for
  accessor methods, so as to fix bug #17355.
  (compute-getter-method, compute-setter-method): #:procedure slot is
  now generic.

* test-suite/tests/goops.test ("accessor slots"): New test.

9 years agoFix accessor struct inlining in GOOPS
Andy Wingo [Sat, 24 Jan 2015 17:59:15 +0000 (18:59 +0100)]
Fix accessor struct inlining in GOOPS

Fixes bug #17355.

* module/oop/goops.scm (memoize-effective-method!): Adapt to
  compute-effective-method change.
  (compute-effective-method, %compute-effective-method): Renamed from
  compute-cmethod; now a generic protocol.
  (compute-specialized-effective-method)
  (%compute-specialized-effective-method): New sub-protocol.
  (memoize-generic-function-application!): Adapt to call the hard-wired
  compute-applicable-methods based on the concrete arguments types --
  the semantics is that %compute-applicable-methods is the
  implementation for <generic> functions.  Perhaps we should do the same
  for sort-applicable-methods and method-more-specific?.
  (compute-getter-method, compute-setter-method): The standard
  #:procedure is now a generic slot-ref.  It wasn't valid to inline
  field access here, because subtypes could have different field
  layouts.
  (compute-applicable-methods): Refactor generic definition to use
  lexical scoping.
  (compute-specialized-effective-method): New method for
  <accessor-method>, which does field access inlining based on the
  concrete types being applied.

* test-suite/tests/goops.test ("accessor slots"): New test.

9 years agoSimplify and optimize slot access
Andy Wingo [Fri, 23 Jan 2015 13:55:35 +0000 (14:55 +0100)]
Simplify and optimize slot access

* module/oop/goops.scm (fold-slot-slots): Add `slot-ref/raw' slot, which
  is what the slot-ref slot was.  Now the slot-ref slot checks that the
  slot is bound, if needed.
  (slot-definition-slot-ref/raw): Define.
  (make-slot): Adapt.  Also, effective slot definition slots have no
  initargs.
  (define-standard-accessor-method, bound-check-get, standard-get)
  (standard-set): Move definitions up.
  (allocate-slots): Adapt.  If the slot has an init thunk, we don't need
  to check that it's bound.
  (slot-ref, slot-set!, slot-bound?): Simplify.
  (class-slot-ref): Use the raw getter so that we can call
  `slot-unbound' with just the class.
  (compute-getter-method, compute-setter-method): Simplify to just use
  the slot-ref / slot-set! functions from the slot.
  (%initialize-object): Simplify.

9 years agoExport <slot> from GOOPS
Andy Wingo [Fri, 23 Jan 2015 13:51:22 +0000 (14:51 +0100)]
Export <slot> from GOOPS

* module/oop/goops.scm (<slot>): Export.  This is the way to tell if you
  have new GOOPS or not: whether <slot> is defined.

9 years agoSimplify GOOPS effective method cache format
Andy Wingo [Wed, 21 Jan 2015 14:53:53 +0000 (15:53 +0100)]
Simplify GOOPS effective method cache format

* module/oop/goops.scm (single-arity-cache-dispatch)
  (compute-generic-function-dispatch-procedure)
  (memoize-effective-method!): Simplify format of effective method
  cache.

9 years agoFast generic function dispatch without calling `compile' at runtime
Andy Wingo [Wed, 21 Jan 2015 14:16:56 +0000 (15:16 +0100)]
Fast generic function dispatch without calling `compile' at runtime

* module/oop/goops.scm: Rewrite generic function dispatch to use chained
  closures instead of compiling specific dispatch procedures.  The big
  speed win before was not allocating rest arguments, which we gain by
  simply pre-generating dispatchers for arities of up to 20 arguments.
  Also now a tail call without reshuffling arguments -- which is what
  dispatch now is -- is just a (mov 0 new-procedure) and (tail-call),
  which is pretty cheap.

  (%invalidate-method-cache!): Use the new
  recompute-generic-function-dispatch-procedure!.
  (arity-case, multiple-arity-dispatcher, single-arity-dispatcher)
  (single-arity-cache-dispatch)
  (compute-generic-function-dispatch-procedure)
  (recompute-generic-function-dispatch-procedure!): New internal
  interfaces.
  (memoize-effective-method!): Update for new interfaces.
  (memoize-generic-function-application!): Rename from `memoize-method!'.

9 years agoGOOPS cosmetics
Andy Wingo [Mon, 19 Jan 2015 21:41:57 +0000 (22:41 +0100)]
GOOPS cosmetics

* module/oop/goops.scm: More commenting.  Move around <keyword> in the
  export section.

9 years agoUpdate (oop goops save) for <slot> objects
Andy Wingo [Mon, 19 Jan 2015 16:11:21 +0000 (17:11 +0100)]
Update (oop goops save) for <slot> objects

* module/oop/goops/describe.scm (describe): Remove commented code.
* module/oop/goops/save.scm (get-set-for-each, access-for-each): Update
  these hoary routines for the new <slot> universe.

9 years agoFix foreign objects for removal of getters-n-setters
Andy Wingo [Mon, 19 Jan 2015 15:58:14 +0000 (16:58 +0100)]
Fix foreign objects for removal of getters-n-setters

* module/system/foreign-object.scm (getter-method): Fix for removal of
  getters-n-setters property.

9 years agoMinor GOOPS cleanups
Andy Wingo [Mon, 19 Jan 2015 14:57:23 +0000 (15:57 +0100)]
Minor GOOPS cleanups

* module/oop/goops.scm: Minor commenting fixes.

9 years agoOptimize %initialize-object
Andy Wingo [Mon, 19 Jan 2015 12:06:44 +0000 (13:06 +0100)]
Optimize %initialize-object

* module/oop/goops.scm (%initialize-object): Optimize by inlining the
  slot initialization, and by avoiding multiple checks for initargs
  validity.

9 years agoInline internal slot accessors
Andy Wingo [Mon, 19 Jan 2015 11:20:50 +0000 (12:20 +0100)]
Inline internal slot accessors

* module/oop/goops.scm (define-slot-accessor): Also define internal
  accessors without the type check for when we know that the object is a
  slot.  Adapt struct-ref users to use these variants.

9 years agoInline helpers into slot-ref, slot-set!, etc
Andy Wingo [Sun, 18 Jan 2015 20:02:51 +0000 (21:02 +0100)]
Inline helpers into slot-ref, slot-set!, etc

* module/oop/goops.scm (%class-slot-definition): New helper.
  (class-slot-definition): Use the new helper.
  (get-slot-value-using-name, set-slot-value-using-name!)
  (test-slot-existence): Remove helpers.
  (slot-ref, slot-set!, slot-bound?, slot-exists?): Inline helpers for
  speed.

9 years agoUse a vtable bit to mark <slot> instances
Andy Wingo [Sun, 18 Jan 2015 20:01:31 +0000 (21:01 +0100)]
Use a vtable bit to mark <slot> instances

* libguile/goops.h (SCM_VTABLE_FLAG_GOOPS_SLOT): Allocate another vtable
  flag to indicate that instances of this vtable are slots.
* libguile/goops.c (scm_init_goops_builtins): Export
  vtable-flag-goops-slot to Scheme.

* module/oop/goops.scm (<slot>, slot?, make-standard-class, initialize):
  Arrange for <slot> classes to have the vtable-flag-goops.slot.
  (build-slots-list): Ensure that <slot> slots are statically laid out.

9 years agoIntroduce <slot> objects in GOOPS
Andy Wingo [Sun, 18 Jan 2015 19:53:19 +0000 (20:53 +0100)]
Introduce <slot> objects in GOOPS

* module/oop/goops.scm (fold-class-slots): Change format to use proper
  slot specifications.
  (fold-slot-slots): Flesh out with all needed slots.
  (<class>): Update cons-layout to deal with new fold-class-slots form.
  Don't create slots; we do that later.
  (is-a?, get-keyword, *unbound, unbound?, %allocate-instance): Move
  definitions up.
  (<slot>, slot?): New definitions.
  (slot-definition-name, slot-definition-allocation)
  (slot-definition-init-keyword, slot-definition-init-form)
  (slot-definition-init-value, slot-definition-init-thunk)
  (slot-definition-options, slot-definition-getter)
  (slot-definition-setter, slot-definition-accessor)
  (slot-definition-slot-ref, slot-definition-slot-set!)
  (slot-definition-index, slot-definition-size): New definitions as
  accessors on <slot> objects.
  (class-slot-definition): Adapt to class-slots change.
  (direct-slot-definition-class, make-slot): New definitions.
  (make): Define a boot version that can allocate <slot> instances.
  (compute-direct-slot-definition)
  (compute-direct-slot-definition-initargs)
  (effective-slot-definition-class, compute-effective-slot-definition):
  New definitions.
  (build-slots-list): Adapt to slots being <slot> objects.
  (compute-get-n-set): New boot definition.
  (allocate-slots): New definition.  Replaces
  compute-getters-n-setters.
  (%compute-layout, %prep-layout): Adapt to changes.
  (make-standard-class): Make <slot> objects for direct-slots, and
  handle the allocate-slots protocol.
  (<foreign-slot>): Inherit from <slot>.
  (get-slot-value-using-name, set-slot-value-using-name!)
  (test-slot-existence): Adapt to using slot definition objects.
  (make-class): Allow slot specs or <slot> objects as the `slots'
  argument.
  (write): New method on <slot>.
  (class-slot-ref, class-slot-set!): Reimplement.
  (compute-slot-accessors, compute-getter-method)
  (compute-setter-method): Adapt to changes.
  (compute-getters-n-setters): Remove.  Yay!
  (compute-get-n-set): Adapt to use effective slot definitions instead
  of the getters-n-setters for #:class / #:each-subclass allocation.
  (%initialize-object): Adapt.
  (initialize): New method for <slot>.  Adapt method for <class>.

* module/oop/goops/active-slot.scm (compute-get-n-set):
* module/oop/goops/composite-slot.scm (compute-propagated-get-n-set):
  Use slot-definition-options to access options of slot.

* test-suite/tests/goops.test ("bad init-thunk"): Fix to be a "pass-if"
  instead of an "expect-fail".

9 years agoBeginnings of <slot> slot definition class
Andy Wingo [Fri, 16 Jan 2015 14:44:48 +0000 (15:44 +0100)]
Beginnings of <slot> slot definition class

* module/oop/goops.scm (define-macro-folder): Factor out this helper.
  (fold-class-slots): Implement using define-macro-folder.
  (fold-slot-slots): New definition, for slots of <slot-definition>.
  (define-slot-indexer): New helper.  Use to define indexes for slots of
  <class> and of <slot>.

9 years agoThe GOOPS "unbound" value is a unique pair
Andy Wingo [Fri, 16 Jan 2015 12:50:21 +0000 (13:50 +0100)]
The GOOPS "unbound" value is a unique pair

* libguile/goops.c (SCM_GOOPS_UNBOUND, SCM_GOOPS_UNBOUNDP): Remove
  internal macros.
  (scm_make_unbound, scm_unbound_p): Remove internal functions.
  (scm_sys_clear_fields_x): Add "unbound" parameter, for the init
  value.

* module/oop/goops.scm (*unbound*): Define in Scheme as a simple
  heap-allocated value.
  (unbound?): New definition.
  (%allocate-instance): Pass *unbound* to %clear-fields!.
  (make-class, slot-definition-init-value)
  (slot-definition-init-form, make-closure-variable): Use *unbound*
  instead of (make-unbound), which is now gone.

* module/oop/goops/active-slot.scm (compute-get-n-set): Use *unbound*
  instead of make-unbound.  This module uses the GOOPS internals module;
  perhaps we should export make-unbound or something...

* module/oop/goops/save.scm (make-unbound): Export our own make-unbound
  definition, for use by residualized save code.

* module/language/ecmascript/base.scm (<undefined>, *undefined*): Use a
  unique object kind and instance for the undefined value.

* libguile/vm.c (scm_i_vm_mark_stack): Fill the stack with
  SCM_UNSPECIFIED instead of SCM_UNBOUND.

9 years agoGOOPS: Deprecate "using-class" procs like slot-ref-using-class
Andy Wingo [Fri, 16 Jan 2015 12:18:05 +0000 (13:18 +0100)]
GOOPS: Deprecate "using-class" procs like slot-ref-using-class

* libguile/deprecated.h:
* libguile/goops.c:
* libguile/goops.h:
* libguile/deprecated.c (scm_slot_ref_using_class):
  (scm_slot_set_using_class_x):
  (scm_slot_bound_using_class_p):
  (scm_slot_exists_using_class_p): Deprecate.

* module/oop/goops.scm (slot-ref-using-class, slot-set-using-class!)
  (slot-bound-using-class?, slot-exists-using-class?): Deprecate.
  Change to check that `class' is indeed the class of `obj', as
  required, and then dispatch to slot-ref et al.

9 years agochange-object-class refactor
Andy Wingo [Fri, 16 Jan 2015 12:02:31 +0000 (13:02 +0100)]
change-object-class refactor

* module/oop/goops.scm (change-object-class): Refactor to use slot-ref,
  slot-bound?, and slot-set! instead of the using-class? variants.

9 years agoslot-ref, slot-set! et al bypass "using-class" variants
Andy Wingo [Fri, 16 Jan 2015 11:55:48 +0000 (12:55 +0100)]
slot-ref, slot-set! et al bypass "using-class" variants

* module/oop/goops.scm (slot-ref, slot-set!, slot-bound?, slot-exists?):
  Bypass slot-ref-using-class, slot-set-using-class!, and so on.  Those
  interfaces are public and have to check that the class is indeed a
  class, they should check that the object is an instance of the class,
  and so on, whereas if we get the class via class-of we know that the
  invariant holds.

9 years agoManipulate GOOPS vtable flags from Scheme, for speed
Andy Wingo [Fri, 16 Jan 2015 10:26:25 +0000 (11:26 +0100)]
Manipulate GOOPS vtable flags from Scheme, for speed

* libguile/goops.h: Remove unimplemented declarations of
  scm_make_next_method, scm_sys_invalidate_method_cache_x, and
  stklos_version.
  (scm_sys_invalidate_class_x): Remove helper definition.  This was
  exported in the past but shouldn't have been.

* libguile/goops.c (scm_sys_make_vtable_vtable): Rename from
  scm_sys_make_root_class, and don't do anything about flags.
  (scm_sys_bless_applicable_struct_vtables_x, scm_class_p)
  (scm_sys_invalidate_class_x): Remove; we do these in Scheme now.
  (scm_init_goops_builtins): Define Scheme values for vtable flags.

* module/oop/goops.scm (vtable-flag-goops-metaclass)
  (class-add-flags!, class-clear-flags!, class-has-flags?)
  (class?, instance?): New definitions.
  (<class>): Add GOOPS metaclass flags from Scheme.
  (<applicable-struct-class>, <applicable-struct-with-setter-class>):
  Add flags from Scheme.
  (make, initialize): Add class flags as appropriate.
  (class-redefinition): Clear the "valid" flag on the old class.
  (check-slot-args): Use instance? instead of a CPL check.

9 years agoGOOPS class slot indices defined as inline values
Andy Wingo [Fri, 16 Jan 2015 09:20:17 +0000 (10:20 +0100)]
GOOPS class slot indices defined as inline values

* module/oop/goops.scm (define-class-index): Define as inline values.

9 years ago`match' refactor in goops.scm
Andy Wingo [Fri, 16 Jan 2015 09:19:47 +0000 (10:19 +0100)]
`match' refactor in goops.scm

* module/oop/goops.scm (compute-dispatch-procedure): Use `match'.

9 years agoConvert emit-linear-dispatch to use match
Andy Wingo [Wed, 14 Jan 2015 19:43:35 +0000 (20:43 +0100)]
Convert emit-linear-dispatch to use match

* module/oop/goops.scm (emit-linear-dispatch): Convert to use `match'.

9 years agoMore GOOPS cleanups
Andy Wingo [Wed, 14 Jan 2015 19:15:53 +0000 (20:15 +0100)]
More GOOPS cleanups

* module/oop/goops.scm (build-slots-list): Use `match'.
  (make-standard-class): Formatting fixes.

9 years agowhen and unless for one-armed ifs in goops.scm
Andy Wingo [Wed, 14 Jan 2015 19:06:35 +0000 (20:06 +0100)]
when and unless for one-armed ifs in goops.scm

* module/oop/goops.scm: Consistently use when or unless for one-armed
  ifs.

9 years agoMore GOOPS comments
Andy Wingo [Tue, 13 Jan 2015 23:01:51 +0000 (00:01 +0100)]
More GOOPS comments

* module/oop/goops.scm: More expository comments.

9 years agoCommenting in goops.scm
Andy Wingo [Tue, 13 Jan 2015 22:16:40 +0000 (23:16 +0100)]
Commenting in goops.scm

* module/oop/goops.scm: More narrative cleanup.

9 years agoNarrative reordering in goops.scm
Andy Wingo [Tue, 13 Jan 2015 22:04:57 +0000 (23:04 +0100)]
Narrative reordering in goops.scm

* module/oop/goops.scm: Reorder for narrative.

9 years agoscm_make cleanup
Andy Wingo [Tue, 13 Jan 2015 20:59:03 +0000 (21:59 +0100)]
scm_make cleanup

* libguile/goops.c (scm_make): Remove SCM_DEFINE around scm_make; the
  real definition is in Scheme.

9 years agoAdd compute-cpl tests
Andy Wingo [Tue, 13 Jan 2015 20:07:42 +0000 (21:07 +0100)]
Add compute-cpl tests

* test-suite/tests/goops.test: Add tests for compute-cpl based on
  comments from goops.scm.

* module/oop/goops.scm (compute-std-cpl): Remove comment, and add
  docstring.
  (compute-cpl): Improve comment.

9 years agoFold (oop goops util) into (oop goops)
Andy Wingo [Mon, 12 Jan 2015 20:43:48 +0000 (21:43 +0100)]
Fold (oop goops util) into (oop goops)

* module/oop/goops/util.scm: Removed.  Instead we fold these definitions
  into goops.scm.

* module/oop/goops/save.scm: Remove useless import of util.scm.

* module/oop/goops.scm: Fold in util.scm.  Since we always use
  add-interesting-primitive!, import (language tree-il primitives) in
  the header.  Clean up some early comments, and use of eval-when.

* module/Makefile.am: Adapt.

9 years agoGOOPS utils module cleanups
Andy Wingo [Mon, 12 Jan 2015 20:40:29 +0000 (21:40 +0100)]
GOOPS utils module cleanups

* module/oop/goops.scm (make-class): Inline find-duplicate to its use
  site.

* module/oop/goops/util.scm (improper->proper): Remove unused function.
  (any, every): Don't re-export these from SRFI-1; users can get them
  from SRFI-1 directly.

9 years agoappend-map rather than mapappend
Andy Wingo [Mon, 12 Jan 2015 20:18:57 +0000 (21:18 +0100)]
append-map rather than mapappend

* module/oop/goops/util.scm: Remove mapappend alias; SRFI-1 append-map
  should be used instead.

9 years agoGOOPS cleanup to use SRFI-1 better
Andy Wingo [Mon, 12 Jan 2015 20:16:25 +0000 (21:16 +0100)]
GOOPS cleanup to use SRFI-1 better

* module/oop/goops.scm (class-subclasses, class-methods): Reimplement
  using stock SRFI-1 procedures.

9 years agoCosmetic goops refactors.
Andy Wingo [Sun, 11 Jan 2015 21:23:51 +0000 (22:23 +0100)]
Cosmetic goops refactors.

* module/oop/goops.scm: Update comments.
* libguile/goops.c: Cosmetic reorderings, re-commentings, and
  de-commentings.

9 years agoIncorporate %inherit-magic! into %init-layout!
Andy Wingo [Sun, 11 Jan 2015 21:01:47 +0000 (22:01 +0100)]
Incorporate %inherit-magic! into %init-layout!

* libguile/goops.c (scm_make_standard_class, scm_sys_init_layout_x):
  Move definitions up.  Incorporate scm_sys_inherit_magic_x into
  scm_sys_init_layout_x.

* libguile/goops.h: Remove scm_sys_init_layout_x declaration.

9 years agogoops.c no longer knows about <class> slot allocation
Andy Wingo [Sun, 11 Jan 2015 20:31:51 +0000 (21:31 +0100)]
goops.c no longer knows about <class> slot allocation

* libguile/goops.c (scm_class_of): Access "redefined" slot by name in
  the case where we need to change the class of an instance.
  (scm_sys_goops_early_init): Move up capture of class-precedence-list
  so SCM_SUBCLASSP can use it.

* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, scm_si_redefined)
  (scm_si_direct_supers, scm_si_direct_slots, scm_si_direct_subclasses)
  (scm_si_direct_methods, scm_si_cpl scm_si_slots)
  (scm_si_getters_n_setters, SCM_N_CLASS_SLOTS, SCM_OBJ_CLASS_REDEF):
  Remove.  Now C code has no special knowledge about the layout of
  GOOPS classes.
  (SCM_SUBCLASSP): Use scm_class_precedence_list to get CPL.
  (SCM_INST, SCM_ACCESSORS_OF): Remove unused macros that were
  undocumented and nonsensical.

9 years agoReimplement inherit-applicable! in Scheme
Andy Wingo [Sun, 11 Jan 2015 19:49:16 +0000 (20:49 +0100)]
Reimplement inherit-applicable! in Scheme

* libguile/goops.c: Move captured keywords and symbols up to the top.
  (scm_i_inherit_applicable): Dispatch to Scheme.
  (scm_sys_goops_early_init): Capture inherit-applicable!.

* module/oop/goops.scm (inherit-applicable!): Scheme implementation.

9 years agoReimplement %allocate-instance in Scheme
Andy Wingo [Sun, 11 Jan 2015 18:11:41 +0000 (19:11 +0100)]
Reimplement %allocate-instance in Scheme

* libguile/goops.c (scm_sys_clear_fields_x): New function.
  (scm_sys_allocate_instance): Remove.  It was available to C but not to
  Scheme and it's really internal.
* libguile/goops.h: Remove scm_sys_allocate_instance.

* module/oop/goops.scm (%allocate-instance): Implement in Scheme, using
  allocate-struct and %clear-fields!.
  (make, shallow-clone, deep-clone, allocate-instance): Adapt to
  %allocate-instance not taking an initargs argument.

9 years agoRe-use the vtable "size" field for GOOPS nfields
Andy Wingo [Sun, 11 Jan 2015 15:36:45 +0000 (16:36 +0100)]
Re-use the vtable "size" field for GOOPS nfields

* module/oop/goops.scm (fold-<class>-slots): The first "reserved" slot
  is actually for instance sizes, used by the "simple struct"
  mechanism.  Reuse this field for GOOPS's "nfields".
  (make-standard-class, <class>, initialize): Adapt order of field
  initializations.

* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, SCM_N_CLASS_SLOTS)
* libguile/goops.c (scm_sys_allocate_instance): Adapt.

9 years agoMove <class> initialization to Scheme
Andy Wingo [Sun, 11 Jan 2015 15:27:16 +0000 (16:27 +0100)]
Move <class> initialization to Scheme

* libguile/goops.c (scm_sys_make_root_class): Just make the
  vtable-vtable, and leave initialization to Scheme.

* libguile/struct.c (scm_i_make_vtable_vtable): Change to take a full
  list of fields, not just the extra fields.
  (scm_init_struct): Adapt to scm_i_make_vtable_vtable change.

* module/oop/goops.scm (<class>): Compute layout for <class>, and
  initialize <class> from here.

9 years agoDeprecate scm_get_keyword
Andy Wingo [Sat, 10 Jan 2015 23:21:58 +0000 (00:21 +0100)]
Deprecate scm_get_keyword

* libguile/deprecated.c (scm_get_keyword): Deprecate.
* libguile/deprecated.h:
* libguile/goops.c:
* libguile/goops.h:

9 years agoRewrite %initialize-object in Scheme
Andy Wingo [Sat, 10 Jan 2015 23:17:22 +0000 (00:17 +0100)]
Rewrite %initialize-object in Scheme

* libguile/goops.h:
* libguile/goops.c (scm_sys_initialize_object): Remove C interface.
  This function was only really useful as part of a GOOPS initialize
  method but was not exported from the goops module.

* module/oop/goops.scm (get-keyword, %initialize-object): Implement in
  Scheme.

9 years agoMinor goops.c tidying
Andy Wingo [Sat, 10 Jan 2015 22:26:41 +0000 (23:26 +0100)]
Minor goops.c tidying

* libguile/goops.c: Reorder static variables.  Remove unused
  sym_procedure.

9 years agoRemove scm_c_extend_primitive_generic
Andy Wingo [Sat, 10 Jan 2015 22:20:47 +0000 (23:20 +0100)]
Remove scm_c_extend_primitive_generic

* libguile/goops.h (scm_c_extend_primitive_generic): Remove public
  interface.  This was introduced in 2003 with the "extended" generics
  but never documented, unused as far as I can tell, and is better
  accessed from Scheme.

* libguile/goops.c: Remove support for scm_c_extend_primitive_generic.
  Simplify capture of change-class.

9 years agoNo more concept of "pure generics"
Andy Wingo [Sat, 10 Jan 2015 22:02:02 +0000 (23:02 +0100)]
No more concept of "pure generics"

* libguile/goops.h (SCM_PUREGENERICP, SCM_VALIDATE_PUREGENERIC)
  (SCM_VTABLE_FLAG_GOOPS_PURE_GENERIC, SCM_CLASSF_PURE_GENERIC):
  Remove.
* libguile/goops.c (scm_set_primitive_generic_x): Use SCM_GENERICP, not
  SCM_PUREGENERICP.
  (scm_sys_bless_pure_generic_vtable_x): Remove; this flag isn't
  checked.

* module/oop/goops.scm: Don't call %bless-pure-generic-vtable!; there's
  no need.

9 years agoRemove TEST_CHANGE_CLASS
Andy Wingo [Fri, 9 Jan 2015 23:55:44 +0000 (00:55 +0100)]
Remove TEST_CHANGE_CLASS

* libguile/goops.c (TEST_CHANGE_CLASS): Remove unused macro and comment.

9 years agoRemove pure-generic?
Andy Wingo [Fri, 9 Jan 2015 23:52:26 +0000 (00:52 +0100)]
Remove pure-generic?

* libguile/goops.h:
* libguile/goops.c (scm_pure_generic_p): Remove function only compiled
  in debug mode.

9 years agoGoops slot-unbound / slot-missing cleanups
Andy Wingo [Fri, 9 Jan 2015 23:51:26 +0000 (00:51 +0100)]
Goops slot-unbound / slot-missing cleanups

* libguile/goops.c: Remove useless slot-unbound / slot-missing
  captures.

9 years agoMove slot-ref et al to Scheme
Andy Wingo [Fri, 9 Jan 2015 23:50:33 +0000 (00:50 +0100)]
Move slot-ref et al to Scheme

* libguile/goops.c:
* module/oop/goops.scm (slot-ref-using-class, slot-set-using-class!):
  (slot-bound-using-class?, slot-exists-using-class?, slot-set!):
  (slot-bound?, slot-exists?): Move implementation to Scheme.

9 years agoPort method and generic accessors to Scheme
Andy Wingo [Fri, 9 Jan 2015 21:05:01 +0000 (22:05 +0100)]
Port method and generic accessors to Scheme

* libguile/goops.c:
* module/oop/goops.scm (generic-function-methods)
  (method-generic-function, method-specializers, method-procedure): Port
  to Scheme.

9 years ago<class> accessors implemented in Scheme
Andy Wingo [Fri, 9 Jan 2015 20:01:03 +0000 (21:01 +0100)]
<class> accessors implemented in Scheme

* libguile/goops.c (scm_class_p): New internal helper, exported to
  goops.scm.
  (scm_class_name, scm_class_direct_supers, scm_class_direct_slots):
  (scm_class_direct_subclasses, scm_class_direct_methods):
  (scm_class_precedence_list, scm_class_slots): Dispatch to Scheme.
  (scm_sys_goops_early_init): Capture <class> accessors.

* module/oop/goops.scm (define-class-accessor): New helper.
  (class-name, class-direct-supers, class-direct-slots):
  (class-direct-subclasses, class-direct-methods)
  (class-precedence-list, class-slots): Define in Scheme.
  (compute-std-cpl, compute-cpl): Move lower.

9 years agogoops: use computed class slot offsets; untabify and fix whitepace
Andy Wingo [Fri, 9 Jan 2015 19:07:06 +0000 (20:07 +0100)]
goops: use computed class slot offsets; untabify and fix whitepace

* module/oop/goops.scm: Untabify and remove trailing whitespace.  Change
  slot-ref on classes to struct-ref of fixed offsets.

9 years agoStatically compute offsets for slots of <class> in Scheme
Andy Wingo [Fri, 9 Jan 2015 18:10:51 +0000 (19:10 +0100)]
Statically compute offsets for slots of <class> in Scheme

* module/oop/goops.scm (macro-fold-left): New helper.
  (define-class-index): Define class-index-FOO for each slot FOO.
  (fold-<class>-slots): Make the slots list have the marks of the
  "visit" macro.

9 years agoRefactor to <class> slot computation
Andy Wingo [Wed, 7 Jan 2015 23:42:27 +0000 (18:42 -0500)]
Refactor to <class> slot computation

* module/oop/goops.scm (macro-fold-right, fold-<class>-slots, <class>):
  Use a macro folder to define (and redefine) class slots.  We'll use
  this to compute static indices as well.

9 years agoRemove GOOPS random state
Andy Wingo [Wed, 7 Jan 2015 21:31:56 +0000 (16:31 -0500)]
Remove GOOPS random state

* libguile/goops.c: Remove GOOPS random state, now that there are no
  more hashsets.

9 years agoMore goops.c cleanups, and fix a security issue
Andy Wingo [Wed, 7 Jan 2015 21:03:09 +0000 (16:03 -0500)]
More goops.c cleanups, and fix a security issue

* libguile/goops.c: Remove unused #includes.
  (make_class_name): New helper, replaces unsafe use of sprintf.
  (scm_make_extended_class): Rewrite to call scm_make_standard_class
  directly.
  (scm_make_port_classes): Rewrite to use scm_make_standard_class, and
  no need to patch the CPL any more.

9 years agoRemove unused union scm_t_debug_info
Andy Wingo [Tue, 6 Jan 2015 20:02:52 +0000 (15:02 -0500)]
Remove unused union scm_t_debug_info

* libguile/debug.h (union scm_t_debug_info): Remove unused type
  declaration.

9 years agoMore unused code removal in GOOPS
Andy Wingo [Tue, 6 Jan 2015 20:00:28 +0000 (15:00 -0500)]
More unused code removal in GOOPS

* libguile/goops.c: Remove unused sym_memoize_method_x.

9 years agoRemove private var_no_applicable_method capture
Andy Wingo [Tue, 6 Jan 2015 19:59:02 +0000 (14:59 -0500)]
Remove private var_no_applicable_method capture

* libguile/goops.c (var_no_applicable_method): Remove unused capture.
  (sym_no_applicable_method): Remove unused symbol.

9 years agoRemove scm_assert_bound
Andy Wingo [Tue, 6 Jan 2015 19:54:44 +0000 (14:54 -0500)]
Remove scm_assert_bound

* libguile/goops.c (scm_assert_bound): Remove unexported unused helper.
* module/oop/goops.scm (make-generic-bound-check-getter): Change
  assert-bound use to use `unbound?'.

9 years agoRemove scm_at_assert_bound_ref
Andy Wingo [Tue, 6 Jan 2015 19:51:44 +0000 (14:51 -0500)]
Remove scm_at_assert_bound_ref

* libguile/goops.c (scm_at_assert_bound_ref): Remove unused, unexported
  function.

9 years agoRemove hashset slots from GOOPS classes
Andy Wingo [Tue, 6 Jan 2015 19:24:27 +0000 (14:24 -0500)]
Remove hashset slots from GOOPS classes

* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, SCM_INSTANCE_HASH)
  (SCM_SET_HASHSET):
* libguile/goops.c (prep_hashsets, scm_sys_make_root_class,
  scm_sys_init_layout_x):
* module/oop/goops.scm (build-<class>-slots): Remove hashsets from
  classes.  We haven't implemented hashed dispatch since Guile 1.8, and
  it's not clear that the particular formulation of dispatch is a good
  idea.

9 years agoDeprecate C exports of GOOPS classes.
Andy Wingo [Tue, 6 Jan 2015 19:16:03 +0000 (14:16 -0500)]
Deprecate C exports of GOOPS classes.

* libguile/deprecated.h:
  (scm_class_boolean, scm_class_char, scm_class_pair)
  (scm_class_procedure, scm_class_string, scm_class_symbol)
  (scm_class_primitive_generic, scm_class_vector, scm_class_null)
  (scm_class_real, scm_class_complex, scm_class_integer)
  (scm_class_fraction, scm_class_unknown, scm_class_top)
  (scm_class_object, scm_class_class, scm_class_applicable)
  (scm_class_applicable_struct, scm_class_applicable_struct_with_setter)
  (scm_class_generic, scm_class_generic_with_setter, scm_class_accessor)
  (scm_class_extended_generic, scm_class_extended_generic_with_setter)
  (scm_class_extended_accessor, scm_class_method)
  (scm_class_accessor_method, scm_class_procedure_class)
  (scm_class_applicable_struct_class, scm_class_number, scm_class_list)
  (scm_class_keyword, scm_class_port, scm_class_input_output_port)
  (scm_class_input_port, scm_class_output_port, scm_class_foreign_slot)
  (scm_class_self, scm_class_protected, scm_class_hidden)
  (scm_class_opaque, scm_class_read_only, scm_class_protected_hidden)
  (scm_class_protected_opaque, scm_class_protected_read_only)
  (scm_class_scm, scm_class_int, scm_class_float)
  (scm_class_double, scm_port_class, scm_smob_class): Deprecate.

* libguile/deprecated.c:
* libguile/goops.c:
* libguile/goops.h: Adapt to deprecation.

* libguile/goops.h
* libguile/goops.c (scm_is_generic, scm_is_method): New interfaces.
  (SCM_GENERICP, SCM_METHODP): Change to use new interfaces.

* libguile/ports.c (scm_make_port_type):
* libguile/smob.c (scm_make_smob_type, scm_set_smob_apply): Use internal
  names for the port and smob class arrays.