summaryrefslogtreecommitdiff
path: root/libguile/struct.c
Commit message (Expand)AuthorAgeFilesLines
* Remove scm_puts_unlocked....* libguile/ports.h (scm_puts_unlocked): Remove. * libguile/ports.c (scm_puts): Replace implementation with scm_puts_unlocked's implementation. * libguile/arbiters.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/continuations.c: * libguile/deprecation.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/guardians.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/load.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/srfi-14.c: * libguile/stackchk.c: * libguile/struct.c: * libguile/threads.c: * libguile/throw.c: * libguile/values.c: * libguile/variable.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked. Andy Wingo2016-04-261-6/+6
* Remove scm_putc_unlocked....* libguile/ports.h (scm_putc_unlocked): Remove. * libguile/ports.c (scm_putc): Replace implementation with scm_putc_unlocked's implementation. (scm_port_print): Use scm_putc. * libguile/arbiters.c: * libguile/arrays.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/continuations.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/r6rs-ports.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/struct.c: * libguile/variable.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_putc instead of scm_putc_unlocked. Andy Wingo2016-04-261-4/+4
* Fix scm_init_struct dependency on port conversion handlers...* libguile/struct.c (scm_init_struct): Use scm_from_latin1_string to avoid locale-dependency for what is really a latin1 string. Also avoids an early dependency on the default port conversion handler, though I wonder if using port conversion handlers in strings is the right thing. Andy Wingo2016-04-141-3/+3
* 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. Andy Wingo2015-01-231-8/+7
* add allocate-struct primitive and rtl opcode...* libguile/struct.h: * libguile/struct.c (scm_allocate_struct): New interface: allocates a struct. * libguile/vm-engine.c (allocate_struct): Instead of make-struct with a rest arg, separate allocation from initialization. Andy Wingo2013-07-211-0/+36
* Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: configure.ac libguile/deprecated.c libguile/deprecated.h libguile/filesys.h libguile/fluids.c libguile/fports.c libguile/gc.c libguile/guile.c libguile/numbers.c libguile/objcodes.c libguile/r6rs-ports.c libguile/smob.c libguile/socket.c libguile/threads.h module/language/scheme/decompile-tree-il.scm module/language/tree-il/peval.scm test-suite/tests/syncase.test Mark H Weaver2013-03-281-5/+5
|\
| * structs with tail arrays are not simple...* libguile/struct.h (SCM_VTABLE_FLAG_SIMPLE, SCM_VTABLE_FLAG_SIMPLE_RW): * libguile/struct.c (set_vtable_layout_flags): Vtable whose layouts include a tail array are not simple. Fixes bug 12808. Andy Wingo2013-03-071-5/+4
| * Implement `hash' for structs....* libguile/hash.c (scm_hasher): Call `scm_i_struct_hash' upon `scm_tcs_struct'. * libguile/struct.c (scm_i_struct_hash): New function. * libguile/struct.h (scm_i_struct_hash): New declaration. * test-suite/tests/structs.test ("hash"): New test prefix. Ludovic Courtès2012-10-121-0/+49
| * set struct names for <standard-vtable>, etc...* libguile/struct.c (scm_init_struct): Set the struct names for <standard-vtable>, <applicable-struct-vtable>, and <applicable-struct-with-setter-vtable>. Andy Wingo2012-07-281-3/+11
| * deprecate make-vtable-vtable...* libguile/struct.h: * libguile/struct.c (scm_make_vtable_vtable): Deprecate, as you can handle most of the use cases with make-vtable, and we don't want to promote the creation of new roots to the type hierarchy. (scm_i_make_vtable_vtable): The internal replacement. Andy Wingo2012-07-281-49/+41
* | update make-struct docstring...* libguile/struct.c (scm_make_struct): Remove reference to deprecated make-vtable-vtable. Andy Wingo2013-01-161-3/+2
* | set struct names for <standard-vtable>, etc...* libguile/struct.c (scm_init_struct): Set the struct names for <standard-vtable>, <applicable-struct-vtable>, and <applicable-struct-with-setter-vtable>. Andy Wingo2012-07-281-3/+11
* | Merge remote-tracking branch 'origin/stable-2.0'...This anticipates deprecation of make-vtable-vtable in stable-2.0, which hasn't happened yet. Conflicts: libguile/deprecated.c libguile/deprecated.h libguile/print.c libguile/struct.c Andy Wingo2012-07-061-111/+1
|\|
| * Scheme standard-vtable-fields binding...* libguile/struct.c (scm_init_struct): Export standard-vtable-fields to Scheme. Andy Wingo2012-07-061-0/+1
| * add Scheme binding for scm_standard_vtable_vtable...* libguile/struct.c (scm_init_struct): Export <standard-vtable> to Scheme. Andy Wingo2012-07-061-0/+1
| * deprecate struct-vtable-tag...* libguile/deprecated.c: * libguile/deprecated.h: * libguile/struct.c: * libguile/struct.h: * doc/ref/api-compound.texi: Deprecate struct-vtable-tag. Andy Wingo2012-07-061-11/+0
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: libguile/expand.c libguile/hashtab.c libguile/ports.c libguile/vectors.c libguile/weaks.c module/language/ecmascript/compile-tree-il.scm module/language/tree-il/effects.scm module/language/tree-il/fix-letrec.scm module/language/tree-il/peval.scm test-suite/tests/peval.test Andy Wingo2012-07-061-1/+1
|\|
| * Use `void *' instead of `GC_PTR' internally....* libguile/finalizers.c, libguile/foreign.c, libguile/guardians.c, libguile/hashtab.c, libguile/numbers.c, libguile/ports.c, libguile/smob.c, libguile/struct.c, libguile/vectors.c, libguile/weaks.c: Use `void *' instead of `GC_PTR'. Ludovic Courtès2012-07-021-1/+1
| * use the new finalizer helpers...* libguile/foreign.c (scm_set_pointer_finalizer_x) * libguile/ports.c (finalize_port) * libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob) * libguile/struct.c (scm_i_alloc_struct) * libguile/numbers.c (make_bignum): Use the new API. Andy Wingo2012-03-081-11/+3
* | use the new finalizer helpers...* libguile/foreign.c (scm_set_pointer_finalizer_x) * libguile/ports.c (finalize_port, scm_c_make_port_with_encoding) (open_iconv_descriptors) * libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob) * libguile/struct.c (scm_i_alloc_struct) * libguile/weak-set.c (weak_gc_finalizer) (scm_c_register_weak_gc_callback) * libguile/weak-table.c (scm_c_register_weak_gc_callback) (weak_gc_finalizer) * libguile/numbers.c (make_bignum): Use the new API. Andy Wingo2012-02-191-11/+3
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: GUILE-VERSION libguile/gc-malloc.c libguile/ports.c Andy Wingo2012-02-081-9/+15
|\|
| * Improve the usage of variable names in C docstrings....* libguile/alist.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/bitvectors.c: * libguile/filesys.c: * libguile/foreign.c: * libguile/generalized-arrays.c: * libguile/hashtab.c: * libguile/ioext.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/procprop.c: * libguile/promises.c: * libguile/simpos.c: * libguile/socket.c: * libguile/srfi-1.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/struct.c: * libguile/symbols.c: * libguile/threads.c: * libguile/weak-table.c: * libguile/weak-vector.c: Make the variable names in the C docstrings more consistent. Replace a few instances of @var with @code when appropriate. Bake Timmons2012-02-021-9/+15
* | Revert "add SCM_HEAP_OBJECT_BASE"...This reverts commit 47ed8656db8800f3ad20a40eb2c4e9ef3dc891e3. Conflicts: libguile/foreign.c Andy Wingo2012-01-311-1/+1
* | deprecate make-vtable-vtable...* libguile/struct.h: * libguile/struct.c (scm_make_vtable_vtable): Deprecate, as you can handle most of the use cases with make-vtable, and we don't want to promote the creation of new roots to the type hierarchy. (scm_i_make_vtable_vtable): The internal replacement. Andy Wingo2011-11-241-2/+35
* | Scheme standard-vtable-fields binding...* libguile/struct.c (scm_init_struct): Export standard-vtable-fields to Scheme. Andy Wingo2011-11-241-0/+1
* | add Scheme binding for scm_standard_vtable_vtable...* libguile/struct.c (scm_init_struct): Export <standard-vtable> to Scheme. Andy Wingo2011-11-241-0/+1
* | locking for putc, puts...* libguile/ports.c (scm_putc, scm_puts): * libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into _unlocked and locked variants. Change all callers to use the _unlocked versions. Andy Wingo2011-11-081-10/+10
* | add SCM_HEAP_OBJECT_BASE...* libguile/tags.h (SCM_HEAP_OBJECT_BASE): New macro. Given a SCM, returns a pointer to the start of its memory area on the heap. * libguile/bytevectors.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/numbers.h: * libguile/ports.c: * libguile/smob.c: * libguile/struct.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Use it. Andy Wingo2011-10-241-1/+1
* | remove weak pairs, rewrite weak vectors...* libguile/weak-vector.c: * libguile/weak-vector.h: Renamed from weaks.[ch]. Remove weak pairs. They were not safe to access with `car' and `cdr'. Remove weak alist vectors, as we have weak tables and sets. Reimplement weak vectors, moving the implementation here. * libguile/vectors.c: * libguile/vectors.h: Remove the extra header word. Use scm_c_weak_vector_ref / scm_c_weak_vector_set_x to access weak vectors. * libguile/snarf.h: Remove the extra header word in vectors. * libguile/threads.c (do_thread_exit, fat_mutex_lock, fat_mutex_unlock): Instead of weak pairs, store thread-owned mutexes in a list of one-element weak vectors. * libguile/guardians.c (finalize_guarded): Similarly, store object guardians in a list of one-element weak vectors. * libguile/modules.c (scm_module_reverse_lookup): We no longer need to handle the case of weak references. * libguile/print.c (iprin1): Use the standard vector accessor to print vectors. * libguile.h: * libguile/Makefile.am: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/goops.c: * libguile/init.c: * libguile/objprop.c: * libguile/struct.c: Update includes. * module/ice-9/weak-vector.scm: Load weak vector definitions using an extension instead of %init-weaks-builtins. * test-suite/tests/weaks.test: Use the make-...-hash-table names instead of the old alist vector names. Andy Wingo2011-10-241-1/+0
|/
* deprecate scm_struct_table...* libguile/goops.h: * libguile/goops.c (scm_i_define_class_for_vtable): New internal helper, defines a class for a vtable, relying on the name slot being set correctly. (scm_class_of, create_struct_classes): Use the local vtable-to-class map instead of scm_struct_table. * libguile/struct.h (SCM_STRUCT_TABLE_NAME, SCM_SET_STRUCT_TABLE_NAME) (SCM_STRUCT_TABLE_CLASS, SCM_SET_STRUCT_TABLE_CLASS, scm_struct_table) (scm_struct_create_handle): Deprecate these internals of the map between structs and classes. * libguile/deprecated.h: * libguile/deprecated.c (scm_struct_create_handle): Deprecated code over here now. Andy Wingo2011-05-011-20/+6
* fix a number of assumptions that a pointer could fit into a long...* libguile/debug.c: * libguile/eval.c: * libguile/frames.c: * libguile/objcodes.c: * libguile/print.c: * libguile/programs.c: * libguile/read.c: * libguile/struct.c: * libguile/vm.c: Fix a number of instances in which we assumed we could fit a pointer into a long. Andy Wingo2010-11-191-1/+2
* add flag to vtables to indicate that their layout is valid...* libguile/struct.h (SCM_VTABLE_FLAG_VALIDATED): New flag, indicates that the layout of a vtable has been validated. The other flags have been renumbered. * libguile/struct.c (scm_i_struct_inherit_vtable_magic): Set the VALIDATED flag if everything goes through. (scm_struct_vtable_p): If the struct should be a vtable but isn't validated, throw an error. (scm_make_vtable_vtable): Validate the incoming user_fields layout bit. Set the VALIDATED flag. (scm_c_make_structv): Add a comment about the case in which we delay scm_i_struct_inherit_vtable_magic. Andy Wingo2010-08-291-9/+21
* check layout when making vtables...* libguile/struct.c (scm_is_valid_vtable_layout): New private layout validating function. (scm_i_struct_inherit_vtable_magic): Do a more proper layout validation, and don't abort. Andy Wingo2010-05-041-2/+42
* optimize and bugfix make-struct VM opcode...* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for make-struct change. * libguile/struct.c (scm_i_alloc_struct): Use scm_words instead of scm_gc_malloc to simplify the code and inline the call to GC_MALLOC. * module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile make-struct/no-tail to make-struct. * module/language/tree-il/primitives.scm (define-primitive-expander): Allow a conditional branch of #f to aboirt inlining. (make-struct): Expand into make-struct/no-tail in the case that tail-size is 0. * libguile/vm-i-scheme.c (make-struct): Adapt to always assume tail-size is 0. Inline allocation if possible. Don't decrement the SP past live objects on the stack, which could cause GC to miss references. Use the NULLSTACK macro. Andy Wingo2010-05-011-7/+6
* Recognize structs with both "pr" and "pw" flags as simple....* libguile/struct.c (set_vtable_layout_flags): Keep the `SCM_VTABLE_FLAG_SIMPLE' flag when VTABLE has a mixture of `r' and `w' fields. * libguile/struct.h (SCM_VTABLE_FLAG_SIMPLE): Adjust comment. Ludovic Courtès2010-01-261-12/+5
* Reinstate 2-word displacement for structs....* libguile/struct.c (scm_init_struct): Reinstate 2-word displacement removed by 01e74380f6170b5cb1105e5df9a368ab257420ef. Ludovic Courtès2010-01-251-0/+5
* Slightly improve comments and style in `struct.c'....* libguile/struct.c (scm_i_struct_inherit_vtable_magic): Comment. Punctuate comments within the body, have them follow GCS. (scm_make_vtable_vtable): Clarify comments. Ludovic Courtès2010-01-231-14/+14
* Clarify GC-registered displacements for structs....* libguile/struct.c (scm_init_struct): Remove unneeded `GC_REGISTER_DISPLACEMENT ()' call. Comment the remaining one. Ludovic Courtès2010-01-231-3/+4
* Optimize struct initialization and accessors for the common case....* libguile/struct.c (set_vtable_layout_flags): New function. (scm_i_struct_inherit_vtable_magic): Use it. (scm_struct_init): Optimize the case where HANDLE's vtable has the `SCM_VTABLE_FLAG_SIMPLE' flag. (scm_struct_ref): Likewise. (scm_struct_ref): Likewise, when `SCM_VTABLE_FLAG_SIMPLE_RW' is also set. * libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Update comment for the next-to-last hidden field. (scm_vtable_index_reserved_6): Rename to... (scm_vtable_index_size): ... this. (SCM_VTABLE_FLAG_RESERVED_0): Rename to... (SCM_VTABLE_FLAG_SIMPLE): ... this. (SCM_VTABLE_FLAG_RESERVED_1): Rename to... (SCM_VTABLE_FLAG_SIMPLE_RW): ... this. * test-suite/tests/structs.test ("low-level struct procedures")["struct-ref", "struct-set!", "struct-ref out-of-range", "struct-set! out-of-range"]: New tests. Ludovic Courtès2010-01-231-136/+229
* scm_i_alloc_struct does not take a "what" arg...* libguile/struct.h: * libguile/struct.c (scm_i_alloc_struct): Change to not take a "what" argument. Callers changed. Andy Wingo2009-12-081-4/+3
* make some applicable struct vtable-vtable public to C...* libguile/struct.h (scm_standard_vtable_vtable) (scm_applicable_struct_vtable_vtable) (scm_applicable_struct_with_setter_vtable_vtable) * libguile/struct.c: Make these stock meta-tables public to C. Andy Wingo2009-12-081-9/+8
* add scm_c_make_struct[v]...* libguile/struct.h (scm_c_make_struct, scm_c_make_structv): New functions with which you can make a struct without consing a rest list. * libguile/struct.c (scm_struct_init): Refactor to take an array of init values, not a list. (scm_make_struct, scm_make_vtable_vtable): Pull the rest arg out into a list and pass it down to the new array-taking functions. * libguile/memoize.c: Remove a neeless #include <alloca>. Andy Wingo2009-12-071-65/+107
* some scm_i_init_guile cleanups...* libguile/init.c (scm_i_init_guile): Since hash tables are tc7 objects, things that depend on hash tables no longer depend on smobs, so move smob_prehistory up a bit. No more struct_prehistory. * libguile/struct.h: * libguile/struct.c (scm_struct_prehistory): Remove empty function. Andy Wingo2009-12-051-6/+0
* 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. Andy Wingo2009-11-261-91/+88
* 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. Andy Wingo2009-11-261-173/+183
* 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. Ludovic Courtès2009-11-171-1/+2
* 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. Andy Wingo2009-11-151-1/+1
* Use proper types for hash/assoc functions in `hashtab.h'....Partly fixes bug #23681 ("Function declarators with empty parentheses should not be used"). * libguile/goops.c (scm_wrap_component): Cast `scm_sloppy_assq'. * libguile/hashtab.c (scm_hash_fn_get_handle): Update to take functions of type `scm_t_hash_fn' and `scm_t_assoc_fn'. Update callers. (scm_ihashx): Change to match `scm_t_hash_fn'. (scm_sloppy_assx): Change to match `scm_t_assoc_fn'. * libguile/hashtab.h (scm_t_hash_fn, scm_t_assoc_fn): New types. (scm_t_hashtable)[hash_fn]: Change to `scm_t_hash_fn'. (scm_i_rehash, scm_hash_fn_get_handle, scm_hash_fn_create_handle_x, scm_hash_fn_ref, scm_hash_fn_set_x, scm_hash_fn_remove_x): Change to take `scm_t_hash_fn' and `scm_t_assoc_fn' parameters. * libguile/srcprop.h (scm_whash_get_handle, scm_whash_create_handle, scm_whash_lookup): Implement in terms of `scm_hashq_*' instead of `scm_hash_fn_*'. * libguile/struct.c (scm_struct_ihashq): Change to match `scm_t_hash_fn'. (scm_struct_create_handle): Cast `scm_sloppy_assq'. * libguile/struct.h (scm_struct_ihashq): Update, make internal. Ludovic Courtès2009-10-201-2/+2
* Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution....* libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'. * libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated. Update to LGPLv3+. Ludovic Courtès2009-09-141-1/+1
* Merge branch 'master' into boehm-demers-weiser-gc...Conflicts: libguile/Makefile.am libguile/bytevectors.c libguile/gc-card.c libguile/gc-mark.c libguile/programs.c libguile/srcprop.c libguile/srfi-14.c libguile/symbols.c libguile/threads.c libguile/unif.c libguile/vm.c Ludovic Courtès2009-08-281-39/+37
|\