* module/rnrs/bytevectors/gnu.scm: New file.
* am/bootstrap.am (SOURCES): Add it.
* libguile/bytevectors.c (scm_bytevector_slice): New function.
* libguile/bytevectors.h (scm_bytevector_slice): New declaration.
* test-suite/tests/bytevectors.test ("bytevector-slice"): New tests.
* doc/ref/api-data.texi (Bytevector Slices): New node.
The spelling mistake is a clear fix, but the Arrays fix might not be as
obvious. Previously, with the "arrays" alias, the @ref macro would
render a superfluous period after the word "arrays", rendering (at least
within Emacs) as:
you may wish to use see arrays. instead.
Signed-off-by: Mikael Djurfeldt <mikael@djurfeldt.com>
These use the argument conventions of vector-copy!, string-copy!,
etc. and not that of bytevector-copy! (which is from r6rs).
* module/srfi/srfi-4/gnu.scm: As stated.
* test-suite/tests/srfi-4.test: Tests.
* doc/ref/srfi-modules.texi: Documentation.
* libguile/bytevectors.c (bytevector-copy!): Add overlap note to
docstring.
* libguile/vectors.c (vector-copy!): Reuse text for the overlap note.
* libguile/bytevectors.c (bytevector-fill!): As stated.
(scm_bytevector_fill_x): Stub to avoid changing the C API.
* doc/ref/api-data.texi: Documentation.
* libguile/vectors.c (vector-fill!): Less confusing variable names.
* test-suite/tests/bytevectors.test: Test partial fill cases for
bytevector-fill!.
* Deprecate scm_is_simple_vector.
* libguile/vectors.c (scm_vector_elements,
scm_vector_writable_elements): These functions take an array; reword
to make this clear.
* libguile/print.h: Remove reference to 'simple vector'.
* doc/ref/api-data.texi: Remove documentation for scm_is_simple_vector.
Remove references to 'simple vector'.
Fix documentation for scm_vector_elements,
scm_vector_writable_elements.
* test-suite/tests/arrays.test:
* test-suite/tests/vectors.test: Remove references to 'simple vector'.
This is up to 20%-30% faster than the previous versions in (scheme base) or
(srfi srfi-43) that used vector-move-left!/vector-move-right!.
* libguile/vectors.h:
* libguile/vectors.c: As stated.
* doc/ref/api-data.texi (vector-copy!): Document the new function.
(vector-fill!): Document optional arguments.
(vector-copy): Document optional arguments.
* module/scheme/base.scm: Reuse core vector-copy!.
* module/srfi/srfi-43.scm: Reuse core vector-copy!.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_set_bits_x)
(scm_c_bitvector_clear_bits_x): Expose only C-like interfaces. No
need to have a SCM_UNDEFINED return.
* libguile/deprecated.c (scm_bit_set_star_x): Adapt.
* doc/ref/api-data.texi (Bit Vectors): Update.
C should use scm_c_bitvector_length, not scm_bitvector_length.
* doc/ref/api-data.texi (Bit Vectors): Reorganize a bit to put typed C
interfaces in their own section.
* libguile/bitvectors.h:
* libguile/bitvectors.c (bitvector-length, bitvector-count): Make
SCM-flavored C interface private.
(scm_c_bitvector_count): New function.
* libguile/deprecated.c (scm_bitvector_length): Deprecate.
(scm_bit_count): Adapt to changes.
This is an opportunity to make a new interface that can be more
efficient in 3.0 (because no generic array support), easier to read (no
need for 'not'), and more consistent with other bitvector interfaces.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/array-handle.h (bitvector_ref, scm_array_get_handle): Adapt
to bitvector changes.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_bit_is_set)
(scm_c_bitvector_bit_is_clear): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bitvector_ref): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace
bitvector-ref with bitvector-bit-set? / bitvector-bit-clear?.
* module/system/vm/disassembler.scm (instruction-has-fallthrough): Use
bitvector-bit-clear?.
* test-suite/tests/bitvectors.test: Update.
The old name was wonky and hard to read: you almost always pass a
literal as the value to set, so better to make separate functions.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_bitvector_set_bits_x)
(scm_bitvector_clear_bits_x): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_set_star_x): Deprecate.
* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
bit-set*! with bitvector-set-bits! / bitvector-clear-bits!.
* module/system/vm/frame.scm (available-bindings, compute-killv): Use
bitvector-set-bits! and bitvector-clear-bits!.
* test-suite/tests/bitvectors.test: Update.
The old name was wonky and had bad argument order.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_bitvector_position): New function.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_position): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-position
with bitvector-position.
* module/language/cps/intset.scm (bitvector->intset): Use
bitvector-position.
* module/system/vm/frame.scm (available-bindings): Use
bitvector-position.
* test-suite/tests/bitvectors.test ("bitvector-position"): Add test.
The old name was wonky and had bad argument order.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (VALIDATE_BITVECTOR): New helper.
(scm_bitvector_count): New function.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_count): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-count with
bitvector-count.
* module/srfi/srfi-60.scm: No need to #:replace bit-count.
* module/system/vm/frame.scm (available-bindings): Use bitvector-count.
* test-suite/tests/bitvectors.test ("bitvector-count"): Add test.
* NEWS: Update.
* doc/ref/api-data.texi (Bit Vectors): Update documentation on bit-set*!
and bit-count*.
* libguile/bitvectors.c: Add a to-do list.
(scm_c_bitvector_ref, scm_c_bitvector_set_x, scm_bitvector_fill_x)
(scm_bitvector_to_list, scm_bit_count, scm_bit_position):
Issue deprecation warnings when used on array slices.
(scm_list_to_bitvector): Simplify.
(scm_bit_set_star_x, scm_bit_count_star): Deprecate arrays as target
bitvectors, and also use of u32vector as selection vector.
* libguile/bitvectors.h:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_istr2bve): Deprecate.
* test-suite/tests/bitvectors.test ("bit-count*"): Remove test of u32
selectors.
* module/ice-9/boot-9.scm (make-record-type): Allow (mutable NAME)
or (immutable NAME) as a field name, and record field mutability in a
bitfield.
(record-modifier): Throw an error if the field isn't mutable.
* test-suite/tests/records.test ("records"): Add tests.
* doc/ref/api-data.texi (Records): Update.
* module/ice-9/boot-9.scm (make-record-type): Don't allow subtyping of
final types.
(%record-type-error): Remove helper.
(record-accessor, record-modifier): Use computed record type
predicate, to allow for subtyping.
(define-record-type): Adapt to %record-type-error going away; these
types are final so no accessor adaptation is needed.
* test-suite/tests/records.test: Add tests.
* doc/ref/api-data.texi (Records): Update.
* module/ice-9/arrays.scm (array-copy): New function, export.
* module/Makefile.am: Install (ice-9 arrays).
* doc/ref/api-data.texi: Add documentation for (ice-9 arrays).
* libguile/quicksort.i.c: Use signed bounds throughout.
* libguile/sort.c (scm_restricted_vector_sort_x): Fix error calls. Fix
calls to quicksort.
* test-suite/tests/sort.test: Actually test that the sorted results
match the original data. Test cases for non-zero base index arrays for
sort, sort!, and stable-sort!.
* 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".
* libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use a normal slot instead
of a self slot.
* libguile/print.c (make_print_state): Initialize "handle" slot
manually.
* libguile/struct.c (issue_deprecation_warning_for_self_slots): New
helper, called when making vtables to issue deprecation warnings for
"self" slots. Avoids warning for the "self" slot that's part of the
fixed vtable slots.
(scm_i_struct_inherit_vtable_magic): Call
issue_deprecation_warning_for_self_slots.
* doc/ref/api-data.texi (Vtables, Structure Basics): Remove references
to self slots.
* NEWS: Add entry.
* doc/ref/api-data.texi: New section 'Arrays as arrays of
arrays'. Document array-from, array-from*, array-amend!,
array-for-each-cell, array-for-each-cell-in-order.