summaryrefslogtreecommitdiff
path: root/test-suite/tests/structs.test
Commit message (Collapse)AuthorAgeFilesLines
* Replace "pr" struct fields with "pw" fieldsAndy Wingo2017-09-231-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Layout is a "pr" field. * module/ice-9/boot-9.scm (record-type-vtable): Record vtable fields are writable. (<parameter>): "pw" fields. * module/oop/goops.scm (<class>, %compute-layout): <read-only> fields are "pw" underneath. * module/rnrs/records/procedural.scm (record-type-vtable) (record-constructor-vtable, make-record-type-descriptor): Use "pw" fields in vtables. * module/srfi/srfi-35.scm (%condition-type-vtable) (struct-layout-for-condition): "pw" fields in vtables. * test-suite/tests/goops.test: * test-suite/tests/structs.test: Use "pw" fields only. * benchmark-suite/benchmarks/structs.bm: Update for make-struct/no-tail, to use pw fields, and also to remove useless tests that the compiler would optimize away. * doc/ref/api-data.texi (Vtables): Add a note about the now-vestigial permissions character and update documentation. (Structure Basics, Meta-Vtables): Update examples. * libguile/hash.c (scm_i_struct_hash): Remove code that would handle opaque/self fields. * libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use "pw" fields. * libguile/struct.c (scm_struct_init): Simplify check for hidden fields. * libguile/values.c (scm_init_values): Field is "pw".
* Deprecate make-structAndy Wingo2017-09-221-42/+28
| | | | | | | | | | | | | | | | | | * libguile/struct.c: Replace uses of scm_make_struct with scm_make_struct_no_tail or scm_c_make_struct. (scm_make_struct_no_tail): Move this function to C instead of Scheme to be able to deprecate scm_make_struct. * libguile/struct.h (scm_make_struct_no_tail): New public declaration. * libguile/deprecated.h: * libguile/deprecated.c (scm_make_struct): Deprecate. * libguile/print.c: * libguile/procs.c: * libguile/stacks.c: Replace uses of scm_make_struct with scm_make_struct_no_tail. * test-suite/tests/coverage.test: * test-suite/tests/structs.test: Use make-struct/no-tail instead of make-struct. * NEWS: Add entry.
* Implement `hash' for structs.Ludovic Courtès2012-10-121-0/+42
| | | | | | | | | * 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.
* update tests after vtable-vtable deprecationAndy Wingo2012-07-281-5/+7
| | | | | | | | | * test-suite/tests/goops.test ("classes for built-in types"): Use a vtable instead of a vtable-vtable. * test-suite/tests/structs.test (ball-root) ("low-level struct procedures", "make-struct"): Rework to use normal vtables instead of making new vtable-vtable.
* Optimize struct initialization and accessors for the common case.Ludovic Courtès2010-01-231-9/+28
| | | | | | | | | | | | | | | | | | | | | | * 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.
* fix a structs.test testAndy Wingo2009-11-151-2/+2
| | | | | * test-suite/tests/structs.test ("equal?"): Instantiate vtables, not vtable-vtables. "hello" is not a valid vtable layout.
* Change Guile license to LGPLv3+Neil Jerram2009-06-171-13/+12
| | | | | | | | | | (Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
* merge from 1.8 branchKevin Ryde2007-03-071-0/+54
|
* Changes from arch/CVS synchronizationLudovic Courtès2007-01-191-6/+19
|
* Added `structs.test'.Ludovic Courtès2006-06-131-0/+94