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

2090 commits

Author SHA1 Message Date
Daniel Llorens
d88d4d5558 Remove scm_from_contiguous_typed_array
This function was undocumented and not used anywhere.

libguile/arrays.h:
libguile/arrays.c: As stated.
2020-04-09 16:59:39 +02:00
Daniel Llorens
9e785509e4 Rewrite vector-copy! using memmove
* libguile/vectors.c (vector-copy!): As stated. Provide C binding
  scm_vector_copy_x.
* module/srfi/srfi-43.scm: Re-export vector-copy! from core.
  (vector-reverse-copy!): Remove definer macro, simplify.
* doc/ref/api-data.texi: Document vector-copy!.
2020-04-09 16:59:39 +02:00
Daniel Llorens
dbf08c3a96 Add lenp parameter back to scm_bitvector_(writable_)elements 2020-04-09 16:59:39 +02:00
Daniel Llorens
bf5b9a86bc Add lenp parameter back to scm_vector_(writable_)elements
Also fix uses.
2020-04-09 16:59:39 +02:00
Daniel Llorens
04c80519bf Simplify interfaces to scm_TYPEvector_(writable_)elements
Nothing is lost in these since the functions already required true typed
vectors, the extra arguments didn't serve any purpose.

Changing my mind from (vec) to (vec, lenp), though. Will fix
vector/bitvector next.

* libguile/srfi-4.h: scm_TYPEvector_(writable_)elements take (vec, lenp).
* libguile/srfi-4.c: Fix implementation.
* libguile/bitvectors.c: Fix use.
* test-suite/standalone/test-srfi-4.c: Fix old test and write variant
  with full array handle interface.
* doc/ref/srfi-modules.texi: Fix doc for srfi-4
  scm_TYPEvector_(writable_)elements.
2020-04-09 16:59:39 +02:00
Daniel Llorens
e3795a39fa Fix doc for last bitvector patch 2020-04-09 16:59:39 +02:00
Daniel Llorens
eb2d2c1a41 Simplify interfaces to scm_vector_elements and scm_vector_writable_elements
* vectors.h: As stated. Don't include array-handle.h.
* vectors.c (scm_vector_elements, scm_vector_writable_elements):
  Reimplement.
  (vector-move-right!, vector-move-left!): Replace uses of
  scm_vector_elements and scm_vector_writable_elements on array types.
* doc/ref/api-data.texi: Fix doc for scm_vector_elements and
  scm_vector_writable_elements.
* libguile/sort.c (stable-sort!): Fix use of
  scm_vector_writable_elements.
2020-04-09 16:59:39 +02:00
Daniel Llorens
40dbe69be5 Simple vectors are just vectors
* doc/ref/api-data.texi: Remove references to 'simple vectors'.
* libguile/vectors.h (SCM_VECTOR_REF,SCM_VECTOR_SET, SCM_VECTOR_LENGHT):
  Renamed from SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET,
  SCM_SIMPLE_VECTOR_LENGTH.
  (scm_is_simple_vector): Remove.

Elsewhere fix uses of SCM_SIMPLE_VECTOR_xxx or scm_is_simple_vector.
2020-04-09 16:59:39 +02:00
Daniel Llorens
6c97c8108e Remove the unused argument from scm_array_p
* libguile/generalized-arrays.h:
* libguile/generalized-arrays.c: As stated.
* doc/ref/api-data.texi: Fix documentation.
* NEWS-array-fixes.txt: Document branch changes.
2020-04-09 16:59:39 +02:00
Daniel Llorens
996bbb47f2 Require vector argument to scm_vector_elements, scm_vector_writable_elements
* libguile/vectors.c (scm_vector_elements, scm_vector_writable_elements): As
  stated.
* libguile/sort.c: Fix usage of scm_vector_elements on possibly non-vector
  array.
* doc/ref/api-data.texi (scm_vector_elements): Remove mention of non-vector
  arrays.
2020-04-09 16:59:39 +02:00
Matt Wette
e37b1fb34c doc: Improve tree-il 'lambda-case' description.
* doc/ref/compiler.texi (Tree-IL): for description of lambda-case
argument 'kw' added "or @code{#f} if there are no keyword arguments".

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-03-28 12:42:09 +01:00
Arun Isaac
b9a09f1ec3 doc: Replace square brackets with round brackets.
* doc/ref/sxml-match.texi: Replace all square brackets with round
brackets in order to be consistent with the rest of the documentation.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-03-25 22:50:26 +01:00
Linus Björnstam
5f60eb6bb5 Add SRFI-171 to guile
This adds SRFI-171 (transducers) to guile.

The two guile-specific additions are powerful transducers which can be
used to generalize transducers like tsegment. They are hard to get
right, but powerful and useful enough to warrant inclusion.

 * doc/ref/srfi-modules.texi: added srfi-171 section
 * module/Makefile.am (SOURCES):
 * module/srfi/srfi-171.scm:
 * module/srfi/srfi-171/meta.scm: Add SRFI-171
 * module/srfi/srfi-171/gnu.scm: Add 2 guile-specific extensions.
 * test-suite/Makefile.am (SCM_TESTS):
 * test-suite/tests/srfi-171.test: Add tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-03-25 22:44:27 +01:00
Isaac Jurado
bef5e0b393 Interpret dynamic library name as literal file name first.
Fixes <https://bugs.gnu.org/21076>.

* libguile/dynl.c (sysdep_dyn_link): Try plain lt_dlopen first, to
  interpret fname as a literal path.
* doc/ref/api-foreign.texi: Update explanation to describe the new
  behavior.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-03-22 00:27:12 +01:00
Jan Synacek
18c7637640 doc: Fix typo in api-debug.texi.
* doc/ref/api-debug.texi (Debugging): Fix typo.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-03-11 12:14:24 +01:00
Ludovic Courtès
41d470f0e9 Reintroduce 'SCM_MEMORY_ERROR' in terms of 'scm_report_out_of_memory'.
Suggested by Dale P. Smith <dsmich@roadrunner.com>.

* libguile/deprecated.h (SCM_MEMORY_ERROR): New macro.
* doc/ref/api-control.texi (Dynamic Wind): Use 'scm_report_out_of_memory'.
2020-02-11 14:47:16 +01:00
Ludovic Courtès
1a3e316c32 Remove traces of 'scm_memory_error'.
'scm_memory_error' was deprecated in 2014 in commit
c2247b782a and removed in 2017 in commit
c248ea10be.  This is a followup.

* libguile/error.h (SCM_MEMORY_ERROR): Remove.
* doc/guile-api.alist: Remove 'scm_memory_error'.
* doc/ref/api-control.texi (Handling Errors): Likewise.
(Dynamic Wind): Use 'scm_misc_error' instead of 'scm_memory_error'.
2020-02-10 00:10:10 +01:00
Ludovic Courtès
c4b2bd3781 texinfo: Add '*line-width*' fluid to control line wrapping.
* module/texinfo/plain-text.scm (*line-width*): New variable.
(wrap*): Honor it.
* doc/ref/texinfo.texi (texinfo plain-text): Document it.
* test-suite/tests/texinfo.plain-text.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
2020-01-29 15:19:37 +01:00
Daniel Llorens
0fee413ff8 Clarify open-input-pipe example in doc 2020-01-24 12:28:29 +01:00
shack@muto.ca
656ce936ed doc: Use gender-neutral language in Preface
* doc/ref/preface.texi: Avoid gendered pronoun.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-01-20 10:23:33 +01:00
Andy Wingo
eadeda40f5 Wording tweak to history.texi
* doc/ref/history.texi (A Scheme of Many Maintainers): Fix wording.
2020-01-13 21:35:15 +01:00
Andy Wingo
838135ca0d Mention Mark Weaver in Guile history section
* doc/ref/history.texi (A Scheme of Many Maintainers): Credit to Mark
  for co-maintaining Guile for more than 5 years.  Thanks!!
2020-01-13 21:33:29 +01:00
Ludovic Courtès
38f14ce65d web: 'open-socket-for-uri' can verify the server's X.509 certificate.
This is largely based on Guix commit
bc3c41ce36349ed4ec758c70b48a7059e363043a and subsequent changes to that
code.

* module/web/client.scm (x509-certificate-directory): New variable.
(set-certificate-credentials-x509-trust-file!*)
(make-credendials-with-ca-trust-files, peer-certificate)
(assert-valid-server-certificate, print-tls-certificate-error): New
procedures.
<top level>: Add call to 'set-exception-printer!'.
(tls-wrap): Add #:verify-certificate? parameter.  When it is true, call
'make-credendials-with-ca-trust-files', pass it to
'set-session-credentials!', and call 'assert-valid-server-certificate'.
(open-socket-for-uri): Add #:verify-certificate? parameter and pass it
to 'tls-wrap'.
(http-request): Add #:verify-certificate? parameter and pass it to
'open-socket-for-uri'.
(define-http-verb): Add #:verify-certificate? parameter and pass it to
'http-request'.
* doc/ref/web.texi (Web Client): Update documentation of
'open-socket-for-uri' and 'http-request'.  Document
'x509-certificate-directory'.
2020-01-13 11:06:01 +01:00
Ludovic Courtès
80bbebef4d web: Add 'current-https-proxy' and honor $https_proxy.
* module/web/client.scm (current-https-proxy): New variable.
(setup-http-tunnel): New procedure.
(open-socket-for-uri): Move 'http-proxy', 'uri', and 'addresses' inside
'open-socket'.  Remove 'with-https-proxy' macro.  Add call to
'setup-http-tunnel'.  Honor 'current-https-proxy' in 'open-socket'.
* doc/ref/web.texi (Web Client): Document 'current-https-proxy'.
* doc/ref/guile.texi: Update copyright years.

Based on Guix commit 9bc8175cfa6b23c31f6c43531377d266456e430e.

Co-authored-by: Sou Bunnbu (宋文武) <iyzsong@gmail.com>
2020-01-13 11:06:01 +01:00
Andy Wingo
287d513ef1 Bump manual year, and fix NEWS typo
* NEWS: Fix a typo.
* doc/ref/guile.texi: Bump copyright year.
2020-01-13 09:52:01 +01: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
Andy Wingo
ba05f1dd6d Mention WebAssembly in status section
* doc/ref/history.texi (Status): Add mention of WebAssembly.
2020-01-06 21:51:02 +01:00
Andy Wingo
272bc09d97 Update compiler.texi and history.texi
* doc/ref/compiler.texi (Extending the Compiler):
* doc/ref/history.texi (A Timeline of Selected Guile Releases):
  (Status): Update.  Thanks to Mikael Djurfeldt for the bug report.
2020-01-06 21:45:33 +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
c23fe0ec5a Document JIT environment variables
* doc/ref/guile-invoke.texi (Environment Variables): Remove
  GUILE_STACK_SIZE which is no longer needed, and document some JIT
  debugging environment variables.
* doc/ref/vm.texi (Why a VM?, Just-In-Time Native Code): Update and link
  to environment variables documentation.
2019-12-11 21:55:49 +01:00
Andy Wingo
0f61d8d797 Add --r6rs and --r7rs options to "guild compile"
* module/scripts/compile.scm (%options, compile): Add --r6rs and --r7rs
  options.
* doc/ref/api-evaluation.texi (Compilation): Add docs.
2019-12-02 17:32:34 +01:00
Andy Wingo
82127b3ad9 Add guile-3, r6rs, r7rs cond-expand features
* module/ice-9/boot-9.scm (%cond-expand-features): Add new features.
* doc/ref/srfi-modules.texi (SRFI-0): Document new features.
2019-12-02 14:34:52 +01:00
Andy Wingo
cf08dbdc18 Associate #:replace info with modules, not variables
* doc/ref/api-modules.texi (Creating Guile Modules): Document
  #:re-export-and-replace.
* module/ice-9/boot-9.scm (module-replacements): New module field.
  (make-module, make-autoload-interface): Initialize replacements to an
  empty hash table.
  (resolve-interface): Propagate replacement info when making custom
  interfaces.
  (define-module): Parse a #:re-export-and-replace keyword arg.
  (define-module*): Handle #:re-export-and-replace.
  (module-export!, module-re-export!): Add a keyword arg to indicate
  whether to replace or not.
  (module-replace!): Call module-export! with #:replace? #t.
  (duplicate-handlers): Update replace duplicate handler to look for
  replacement info on the interfaces.
* module/srfi/srfi-18.scm (srfi):
* module/srfi/srfi-34.scm (srfi): Update to #:re-export-and-replace
  raise-continuable as raise.
2019-11-29 11:51:29 +01:00
Andy Wingo
59febb4b2d Fix port-position documentation
* doc/ref/r6rs.texi (rnrs io ports): Update the translation for
  port-position.
2019-11-25 09:47:04 +01:00
Andy Wingo
cc3190ed95 Fix texinfo in r7rs.texi
* doc/ref/r7rs.texi (R7RS Standard Libraries): Fix syntax.
2019-11-22 15:56:24 +01:00
Andy Wingo
1907e59c09 Install exception converters and printers from boot-9
* doc/ref/intro.texi (Guile and Scheme): Fix a date.
* module/ice-9/boot-9.scm: Load (ice-9 exceptions).
2019-11-21 16:48:35 +01:00
Andy Wingo
b634071dd4 Add R7RS documentation and --r7rs command-line option
* doc/ref/Makefile.am: Add r7rs.texi.
* doc/ref/guile-invoke.texi (Command-line Options): Document --r7rs.
* doc/ref/guile.texi (Guile Modules): Link to R7RS.
* doc/ref/intro.texi (Guile and Scheme): Update for R7RS support.
* doc/ref/r7rs.texi: New file.
* doc/ref/scheme-intro.texi (Guile Scheme): Update for R7RS.
* module/ice-9/command-line.scm (*usage*, compile-shell-switches): Add
  --r7rs option.
2019-11-17 15:30:59 +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
44ee8c5559 Update documentation for with-exception-handler et al
* doc/ref/api-control.texi (Prompt Primitives): Reference the newer
  exception facilities.
  (Exceptions): Rewrite to use the new exception primitives.
  (Exception Terminology): Remove superfluous section.
  (Exception Objects): New section.
  (Raising and Handling Exceptions): New section.
  (Throw and Catch): New section, coalescing the previous catch,
  with-throw-handler, and throw sections.
  (Exceptions and C): New section, for miscellaneous procedures.
  (Handling Errors): Mention the transitional period regarding exception
  handling.
* doc/ref/api-debug.texi (Catching Exceptions): Rewrite to use newer
  exception facilities.
  (Capturing Stacks): Remove, as it's not really recommendable any
  more.
  (Pre-Unwind Debugging): Rewrite to use the new primitives.
  (Standard Error Handling): Add note about transitional status.
  (Stack Overflow): Reference new exception section.
* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
  Reference new exception section.
* doc/ref/r6rs.texi (rnrs exceptions, rnrs conditions): Update to
  mention compatibility with SRFI-34/35 and to relate to core
  exceptions.
* doc/ref/srfi-modules.texi (SRFI-34): Document.
2019-11-13 22:33:09 +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
Andy Wingo
42c69ae669 Fix doc syntax error
* doc/ref/r6rs.texi (R6RS Incompatibilities): Fix syntax error.
2019-09-27 22:52:57 +02:00
Andy Wingo
714d0b9d9f Better R6RS compatibility
* module/ice-9/boot-9.scm (install-r6rs!): Also enable
  `hungry-eol-escapes'.
* doc/ref/r6rs.texi (R6RS Incompatibilities): Document lack of unicode
  escapes in symbols.
2019-09-27 14:08:02 +02:00
Andy Wingo
afcc22f639 Add --r6rs command-line option
* doc/ref/guile-invoke.texi (Command-line Options): Document --r6rs.
* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention that --r6rs calls
  install-r6rs!.
* module/ice-9/command-line.scm (*usage*, compile-shell-switches):
  Implement --r6rs.
2019-09-25 22:08:12 +02:00
Andy Wingo
0bb980f120 New function: install-r6rs!
* doc/ref/r6rs.texi (R6RS Incompatibilities): Document install-r6rs!.
* module/ice-9/boot-9.scm (install-r6rs!): New function.
2019-09-25 22:06:38 +02:00
Andy Wingo
462782af86 Add documentation for else, =>, _, ... aux syntax
* doc/ref/api-macros.texi (Syntax Rules): Document aux syntax.
2019-09-19 15:42:57 +02:00
Andy Wingo
4e89d0c061 Use "G_" as the conventional alias for gettext
Since the change in 2.2 noted in the NEWS as "Fix literal matching for
module-bound literals", defining `_' makes `syntax-rules' and `match'
fail to recognize `_' as the catch-all literal.  This change adapts the
recommendations to current practice in 2.2, as users have had to adapt
to this change.

* doc/ref/api-i18n.texi (Gettext Support): Update documentation.
* module/language/tree-il/analyze.scm (proc-ref?, gettext?): G_ is the
  conventional abbreviation, not _.
* test-suite/tests/tree-il.test: Adapt.
* module/ice-9/command-line.scm: Use G_ instead of _.
2019-09-12 21:50:35 +02:00
Andy Wingo
5284b9b9c6 Update documentation for mixed definitions and expressions
* NEWS: Update.
* doc/ref/api-binding.texi (Internal Definitions): Update to mention
  that mixed definitions and expressions are allowed.
* doc/ref/scheme-ideas.texi (Creating a Procedure):
  (Lambda Alternatives): Update documentation to avoid implying that
  bodies are only expressions.
2019-08-25 17:05:38 +02:00