1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

215 commits

Author SHA1 Message Date
Morgan Smith
f27e8b855f
Fix typos throughout codebase.
* NEWS:
* doc/ref/api-control.texi:
* doc/ref/api-data.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-deprecated.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-foreign.texi:
* doc/ref/api-i18n.texi:
* doc/ref/api-io.texi:
* doc/ref/api-languages.texi:
* doc/ref/api-macros.texi:
* doc/ref/api-memory.texi:
* doc/ref/api-modules.texi:
* doc/ref/api-options.texi:
* doc/ref/api-peg.texi:
* doc/ref/api-procedures.texi:
* doc/ref/api-scheduling.texi:
* doc/ref/api-undocumented.texi:
* doc/ref/api-utility.texi:
* doc/ref/expect.texi:
* doc/ref/goops.texi:
* doc/ref/misc-modules.texi:
* doc/ref/posix.texi:
* doc/ref/repl-modules.texi:
* doc/ref/scheme-ideas.texi:
* doc/ref/scheme-scripts.texi:
* doc/ref/srfi-modules.texi:
* gc-benchmarks/larceny/dynamic.sch:
* gc-benchmarks/larceny/twobit-input-long.sch:
* gc-benchmarks/larceny/twobit.sch:
* libguile/gc.h:
* libguile/ioext.c:
* libguile/list.c:
* libguile/options.c:
* libguile/posix.c:
* libguile/threads.c:
* module/ice-9/boot-9.scm:
* module/ice-9/optargs.scm:
* module/ice-9/ports.scm:
* module/ice-9/pretty-print.scm:
* module/ice-9/psyntax.scm:
* module/language/elisp/parser.scm:
* module/language/tree-il/compile-bytecode.scm:
* module/srfi/srfi-37.scm:
* module/srfi/srfi-43.scm:
* module/statprof.scm:
* module/texinfo/reflection.scm:
* test-suite/tests/eval.test:
* test-suite/tests/fluids.test:
Fix typos.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-06 11:51:53 +02:00
Morgan Smith
c7d170c5d1
Fix typos throughout codebase.
* NEWS:
* README:
* doc/r5rs/r5rs.texi:
* doc/ref/api-data.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-io.texi:
* doc/ref/api-macros.texi:
* doc/ref/api-procedures.texi:
* doc/ref/api-scheduling.texi:
* doc/ref/api-undocumented.texi:
* doc/ref/libguile-concepts.texi:
* doc/ref/posix.texi:
* doc/ref/srfi-modules.texi:
* doc/ref/vm.texi:
* doc/ref/web.texi:
* examples/box-dynamic-module/box.c:
* examples/box-dynamic/box.c:
* examples/box-module/box.c:
* examples/box/box.c:
* examples/safe/safe:
* examples/scripts/README:
* examples/scripts/hello:
* gc-benchmarks/larceny/twobit-input-long.sch:
* gc-benchmarks/larceny/twobit-smaller.sch:
* gc-benchmarks/larceny/twobit.sch:
* libguile/expand.c:
* libguile/load.c:
* libguile/net_db.c:
* libguile/scmsigs.c:
* libguile/srfi-14.c:
* libguile/threads.c:
* meta/guile.m4:
* module/ice-9/match.upstream.scm:
* module/ice-9/ports.scm:
* module/language/cps/graphs.scm:
* module/scripts/doc-snarf.scm:
* module/srfi/srfi-19.scm:
* module/system/repl/command.scm:
* test-suite/tests/srfi-18.test:
Fix typos.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-07-16 22:09:01 +02:00
Daniel Llorens
e903b76795 Document R7RS functions related to bytevectors
* doc/ref/api-data.texi (Bytevectors): Fix typo in (r6:bytevector-copy),
  index need not be positive.
  Fix typos in bytevector-length, bytevector=, bytevector-fill!.
  New node 'Bytevector Procedures in R7RS'.
  (Bytevector Procedures in R7RS): Document R7RS bytevector,
  bytevector-copy, bytevector-copy!, bytevector-append.
* doc/ref/api-io.texi (Binary I/O): Document R7RS
  open-output-bytevector, write-u8, read-u8, peek-u8,
  get-output-bytevector, open-input-bytevector, read-bytevector!,
  read-bytevector, write-bytevector.
* doc/ref/r7rs.texi (R7RS support): Link to R7RS standard.
2023-01-17 16:07:48 +01:00
Ludovic Courtès
e441c34f16 Add 'bytevector-slice'.
* 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.
2023-01-14 16:14:17 +01:00
Colin Woodbury
856c3f96fa doc: Fix minor typos
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>
2022-12-09 13:15:56 +01:00
Ludovic Courtès
8e2e2ceb17 Deprecate symbol properties.
* libguile/strings.c (scm_i_make_symbol): Remove 'props' argument.  Use
3 words instead of 'scm_double_cell'.
* libguile/strings.h: Adjust accordingly.
* libguile/symbols.c (scm_i_str2symbol, scm_i_str2uninterned_symbol):
Likewise.
(scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x,
scm_symbol_pset_x): Move to...
* libguile/deprecated.c: ... here.  Rewrite in terms of object
properties.
(symbol_function_slot, symbol_property_slot): New variables.
* libguile/symbols.h (SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC)
(SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS)
(scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x)
(scm_symbol_pset_x): Move to...
* libguile/deprecated.h: ... here.  Mark declarations as 'SCM_DEPRECATED'.
* module/system/base/types.scm (cell->object): Remove 'props' field for
%TC7-SYMBOL.
* doc/ref/api-data.texi (Symbol Props): Remove.
* NEWS: Update.
2022-02-04 11:12:28 +01:00
Daniel Llorens
d70c1dbebf New function bitvector-copy (scm_bitvector_copy)
* libguile/bitvectors.h:
* libguile/bitvectors.c: As stated.
* test-suite/tests/bitvectors.test: Tests.
* doc/ref/api-data.texi: Update "Bit vectors" section.
* NEWS: Update.
2022-01-04 12:28:41 +01:00
Daniel Llorens
708df04f3b Update NEWS 2021-10-27 10:09:59 +02:00
Daniel Llorens
6be51f9bbf Provide xxvector-copy and xxvector-copy! for srfi-4 vectors
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.
2021-10-21 15:05:46 +02:00
Daniel Llorens
9a62f7caca Extend bytevector-fill! to handle a partial fill
* 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!.
2021-08-17 16:47:04 +02:00
Daniel Llorens
c2cf685b65 Remove the 'simple vector' concept
* 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'.
2021-08-16 15:39:21 +02:00
Daniel Llorens
5df5555d12 Add function vector-copy! to core
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!.
2021-08-06 17:13:21 +02:00
Daniel Llorens
a34c762de0 Extend core vector-copy to r7rs vector-copy
* libguile/vectors.h: Declare scm_vector_copy_partial.
* libguile/vectors.c (scm_vector_copy_partial): As stated.
  (scm_vector_copy): Reuse scm_vector_copy_partial.
* module/scheme/base.scm: Reuse core vector-copy.
* module/srfi/srfi-43: Reuse core vector-copy.
* test-suite/tests/vectors.test: Test vector-copy.
2021-08-06 13:06:51 +02:00
Andy Wingo
e9c5a1719b Move copy-tree to (ice-9 copy-tree); deprecate main binding
* doc/ref/api-data.texi (List Constructors):
* doc/ref/api-utility.texi (Copying): Update docs to mention module.
* libguile.h: Remove trees.h inclusion.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Remove trees.c,
  trees.h, and related files.
* libguile/init.c (scm_i_init_guile): Remove trees.h and the
  scm_init_trees call.
* libguile/trees.c:
* libguile/trees.h: Remove.
* module/Makefile.am (SOURCES): Add ice-9/copy-tree.scm.
* module/ice-9/copy-tree.scm: New file.
* module/ice-9/deprecated.scm (copy-tree*): Export as copy-tree,
  proxying to (ice-9 copy-tree).
* module/system/repl/common.scm:
* module/web/client.scm:
* test-suite/tests/elisp.test:
* test-suite/tests/srfi-1.test:
* module/oop/goops/save.scm: Use (ice-9 copy-tree).
* test-suite/Makefile.am (SCM_TESTS): Add copy-tree.test.
* test-suite/tests/copy-tree.test: New file; test pulled from
  eval.test.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_copy_tree): Deprecate.
2020-09-10 21:57:21 +02:00
Arun Isaac
67f5b451b0 doc: Document default delimiter of string-join.
* doc/ref/api-data.texi (String Constructors): Document default
delimiter of the string-join function.
* libguile/srfi-13.c (scm_string_join): Adjust docstring accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-18 00:30:30 +02:00
Andy Wingo
607183679e Deprecate scm_bitvector, scm_make_bitvector, scm_bitvector_p
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c:
* libguile/deprecated.c:
* libguile/deprecated.h: Deprecate scm_bitvector, scm_make_bitvector,
  and scm_bitvector_p.
* libguile/read.c (scm_read_guile_bit_vector): Use scm_list_to_bitvector
  instead of scm_bitvector.
2020-04-29 11:14:17 +02:00
Andy Wingo
8861af39ae Prefer C-like interfaces for scm_c_bitvector_{set,clear}_bits_x
* 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.
2020-04-29 11:14:17 +02:00
Andy Wingo
b517a91ba4 Deprecate useless C bitvector interface
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.
2020-04-29 11:14:17 +02:00
Andy Wingo
bfd38b8577 bitvector-count-bits replaces bit-count*
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_count_bits): New function.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_count_star): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-count* with
  bitvector-count-bits.
* test-suite/tests/bitvectors.test: Update.
2020-04-29 11:14:17 +02:00
Andy Wingo
f897efa9f1 bitvector-flip-all-bits! replaces bit-invert!
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_flip_all_bits_x): New function.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_invert_x): Deprecate.
* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
  bit-invert! with bitvector-flip-all-bits!.
* module/system/vm/frame.scm (available-bindings): Use the new
  interface.
* test-suite/tests/bitvectors.test: Update.
2020-04-18 22:16:31 +02:00
Andy Wingo
d7fea13453 bitvector-set-all-bits! / bitvector-clear-all-bits! replace bitvector-fill!
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_set_all_bits_x)
  (scm_c_bitvector_clear_all_bits_x): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bitvector_fill_x): Deprecate.
* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
  bitvector-fill! with bitvector-set-all-bits! /
  bitvector-clear-all-bits!.
* module/system/vm/disassembler.scm (static-opcode-set): Use
  bitvector-set-bit!.
* module/system/vm/frame.scm (available-bindings): Use the new
  interfaces.
* test-suite/tests/bitvectors.test: Update.
2020-04-15 22:14:25 +02:00
Andy Wingo
8110061e64 bitvector-set-bit! / bitvector-clear-bit! replace bitvector-set!
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/array-handle.h (bitvector_set_x, scm_array_get_handle): Adapt
  to bitvector changes.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_set_bit_x)
  (scm_c_bitvector_clear_bit_x): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bitvector_set_x): Deprecate.
* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
  bitvector-set! with bitvector-set-bit! / bitvector-clear-bit!.
* module/system/vm/disassembler.scm (static-opcode-set): Use
  bitvector-set-bit!.
* module/system/vm/frame.scm (compute-defs-by-slot, available-bindings):
  Use bitvector-set-bit!.
* test-suite/tests/bitvectors.test: Update.
2020-04-14 22:40:43 +02:00
Andy Wingo
d804177be4 bitvector-bit-set? / bitvector-bit-clear? replace bitvector-ref
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.
2020-04-14 22:18:02 +02:00
Andy Wingo
ff9979b6bc Replace bit-set*! with bitvector-set-bits! / bitvector-clear-bits!
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.
2020-04-13 22:06:56 +02:00
Andy Wingo
06709d77b9 Replace bit-position with bitvector-position
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.
2020-04-12 22:39:55 +02:00
Andy Wingo
cae74359de Replace bit-count with bitvector-count
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.
2020-04-12 22:17:22 +02:00
Andy Wingo
24a34074ef Deprecate bitvector-ref on array slices
* 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.
2020-04-12 21:36:30 +02:00
Andy Wingo
86a9f9a271 Optionally allow duplicate field names in core records
* NEWS: Update.
* doc/ref/api-data.texi (Records): Update docs.
* module/ice-9/boot-9.scm (make-record-type): Add
  #:allow-duplicate-field-names? keyword argument.
  (record-accessor, record-modifier): Allow passing indexes to identify
  fields.
* module/rnrs/records/procedural.scm (make-record-type-descriptor):
  Allow duplicate field names.  Fixes #38611.
2020-01-12 21:51:22 +01:00
Daniel Llorens
6cfee36543 New function string-replace-substring in (ice-9 string-fun)
By A. Wingo in
https://lists.gnu.org/archive/html/guile-devel/2014-03/msg00058.html.

* module/ice-9/string-fun.scm (string-replace-substring): As stated.
* doc/ref/api-data.texi: Document the new function.
* test-suite/tests/strings.test: Test.
2020-01-06 09:44:01 +01:00
Andy Wingo
4b2c512b94 Update NEWS for records and exceptions work
* NEWS: Update.
* doc/ref/api-data.texi (Records): Fix a typo.
2019-11-14 21:37:00 +01:00
Andy Wingo
315fabdfe7 Add support for immutable fields in core records
* 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.
2019-10-28 16:59:58 +01:00
Andy Wingo
f963bdf02d Rename final? record type flag; add support for opaque?
* module/ice-9/boot-9.scm (record-type-extensible?): Rename from
  record-type-final?, with the opposite sense.
  (record-type-opaque?): New accessor.
  (make-record-type): Change #:final? to #:extensible?, with the
  opposite meaning.  Add #:opaque? arg.
* test-suite/tests/records.test ("records"): Add opaque tests; update
  extensible tests.
* doc/ref/api-data.texi (Records): Update.
* module/srfi/srfi-35.scm (&condition, make-condition-type): Update for
  make-record-type API change.
2019-10-27 21:31:18 +01:00
Andy Wingo
7a8e314d31 Guile `make-record-type' supports non-generative definition
* module/ice-9/boot-9.scm (prefab-record-types): New definition.
  (make-record-type): Add #:uid keyword.
* test-suite/tests/records.test ("records"): Add tests.
* doc/ref/api-data.texi (Records): Document #:uid
2019-10-27 20:55:01 +01:00
Andy Wingo
f060f1a4e6 Record accessors respect subtyping
* 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.
2019-10-22 16:22:48 +02:00
Ludovic Courtès
4024a5beb3 doc: Fix typo about SRFI-4 syntax.
Reported by Matt Wette <matt.wette@gmail.com>.
Fixes <https://bugs.gnu.org/29910>.

* doc/ref/api-data.texi (Array Syntax): Fix typo.
2018-08-07 11:40:22 +02:00
Andy Wingo
f85d3c0bd8 Merge until e0bcda4ad9 from stable-2.2 2017-11-29 21:04:59 +01:00
Daniel Llorens
3bfd4aaa6e Fix sort, sort! for arrays with nonzero lower bound
* 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!.
2017-10-31 13:23:17 +01:00
Daniel Llorens
ffcdb7bddf Remove documentation on uniform-vector-read!, uniform-vector-write
* NEWS: Add specific removal notice.
* doc/ref/api-data.texi: Remove documentation on uniform-vector-read!,
  uniform-vector-write.
2017-10-31 13:23:17 +01:00
Andy Wingo
84259f54e3 Merge 'stable-2.2'
Resolve conflicts by removing capability of struct-ref / struct-set! to
access unboxed slots.
2017-09-25 22:18:13 +02:00
Andy Wingo
a74d4ee4f6 Add struct-ref/unboxed, struct-set!/unboxed
* NEWS: Add news entry.
* doc/ref/api-data.texi (Vtables, Structure Basics): Update
  documentation.
* libguile/struct.c (scm_i_struct_equalp): Avoid using struct-ref on
  unboxed fields.
  (scm_struct_ref, scm_struct_set_x_unboxed): Issue deprecation warning
  when accessing unboxed fields.
  (scm_struct_ref_unboxed, scm_struct_set_x_unboxed): New functions.
* libguile/struct.h (scm_struct_ref_unboxed, scm_struct_set_x_unboxed):
  New functions.
* module/oop/goops.scm (class-add-flags!, class-clear-flags!):
  (class-has-flags?, <class>, %allocate-instance, <slot>):
  (compute-get-n-set, unboxed-get, unboxed-set, unboxed-slot?):
  (allocate-slots, %prep-layout!, make-standard-class, initialize):
  Adapt to access unboxed nfields and flags fields via the new
  accessors.
2017-09-25 21:54:36 +02:00
Andy Wingo
5870188eb4 Replace "pr" struct fields with "pw" fields
* 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".
2017-09-23 15:33:02 +02:00
Andy Wingo
b0ecf83ef0 Deprecate opaque struct fields
* NEWS: Add entry.
* doc/ref/api-data.texi (Vtables, Structure Basics): Remove mention of
  opaque field protection.
* libguile/struct.c (scm_make_struct_layout, scm_make_struct_no_tail):
  Remove discussion of opaque fields.
  (set_vtable_layout_flags): Issue a deprecation warning when opaque
  fields are used.
2017-09-23 11:14:27 +02:00
Andy Wingo
04f48e94b5 Deprecate struct "self" slots
* 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.
2017-09-22 11:35:36 +02:00
Andy Wingo
53d4df80c9 Remove references to tail arrays in the documentation
* doc/ref/api-data.texi (Vtables, Structure Basics): Update to remove
  references to tail arrays, in preparation for deprecation.
2017-09-20 22:19:49 +02:00
Sergei Trofimovich
410bb56d23 Documentation typo tweak
* doc/ref/api-data.texi: Tweak 'u+0007' to 'U+0007' (as in the rest of
  the table).

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2017-04-19 17:15:56 +02:00
Georgi Kirilov
a4fbc5b091 doc: Fix typo in keywords documentation.
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-01 21:02:24 +01:00
Ludovic Courtès
1107db3eb1 Document 'scm_to_uintptr_t' and 'scm_from_uintptr_t'.
* doc/ref/api-data.texi (Integers): Document them.
2017-03-01 19:56:55 +01:00
Diogo F. S. Ramos
f8dd4f67b5 Explain why no native accessors for s8' and u8' exist
* doc/ref/api-data.texi: Instead of saying it is obvious, explain why
  no native endianness accessors exist for the `s8' and `u8' variants.
2017-02-27 21:32:59 +01:00
Daniel Llorens
7e93950552 Final names for new array functions
Globally rename (array-from* -> array-slice), (array-from ->
array-cell-ref), (array-amend! -> array-cell-set!), (array-for-each-cell
-> array-slice-for-each).
2017-01-09 09:02:04 +01:00
Daniel Llorens
0bd7562c96 Document new array functions, with provisional names
* 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.
2016-11-23 13:05:18 +01:00