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

2401 commits

Author SHA1 Message Date
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
Andy Wingo
31cb10af81 Letrectify only on -O2; update docs
* doc/ref/api-evaluation.texi (Compilation): Document the -O options.
* doc/ref/api-modules.texi (Using Guile Modules): @@ docs refer to
  declarative modules.
  (Creating Guile Modules): Use when for 1-armed if.
  (Declarative Modules): Make implications of declarative bindings more
  explicit, and explicitly document ways to disable the optimization.
* module/language/tree-il/optimize.scm (tree-il-optimizations): Punt
  letrectification to -O2.
2019-08-25 12:51:03 +02:00
Andy Wingo
356ea09719 Add notion of declarative modules
* doc/ref/api-modules.texi (Declarative Modules): New subsection.
* module/ice-9/boot-9.scm (module): Change eval-closure slot, which was
  deprecated and unused, to be a "declarative?" slot, indicating that
  definitions from the module are declarative.
  (user-modules-declarative?): New parameter.
  (make-fresh-user-module): Set declarative according to parameter.
  (define-module*, define-module): Add #:declarative? keyword argument,
  defaulting to the value of user-modules-declarative? parameter when
  the module was expanded.
  (guile-user): This module is not declarative.

* module/language/tree-il/letrectify.scm (compute-declarative-toplevels):
  Use the new declarative? module flag.
2019-08-18 22:27:12 +02:00
Andy Wingo
3869cdc59d Merge from stable-2.2 2019-08-02 15:34:28 +02:00
Andy Wingo
8ee6e766b8 Merge from stable-2.2 2019-08-02 15:30:13 +02:00
Andy Wingo
aad64cf381 Merge from stable-2.2 2019-08-02 15:29:33 +02:00
Andy Wingo
663b26819e Merge from stable-2.2 2019-08-02 15:04:14 +02:00
Andy Wingo
c5526c4e40 Merge from stable-2.2 2019-08-02 15:02:11 +02:00
Ludovic Courtès
63f54a7bc6 doc: Document optional parameter of 'stat'.
Fixes <https://bugs.gnu.org/34860>.
Reported by Tim Gesthuizen <tim.gesthuizen@yahoo.de>.

* doc/ref/posix.texi (File System): Document 'exception_on_error'
parameter of 'stat'.
2019-06-30 17:26:43 +02:00
Paul Morris
f2c11dc181 doc: Fix argument list in match-lambda docs
* doc/ref/match.texi: Fix argument list for match-lambda.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-24 15:24:33 +02:00
Arun Isaac
77c4f2f48d doc: Fix minor typo in the HTTP headers documentation.
* doc/ref/web.texi (HTTP Headers): Fix minor typo.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-24 15:24:23 +02:00
Ludovic Courtès
f4f9d177f0 Remove references to 'inet-ntoa' and 'inet-aton'.
These procedures were removed in Guile 2.2 by commit
fc7bd367ab (May 2011).

* libguile/socket.h (scm_inet_aton, scm_inet_ntoa): Remove.
* module/system/repl/server.scm (make-tcp-server-socket): Use
'inet-pton' instead of 'inet-aton'.
* doc/ref/web.texi (HTTP): Likewise in 'declare-header!' example.
* doc/ref/posix.texi (Network Address Conversion): Remove documentation
of 'inet-ntoa' and 'inet-aton'.
2019-06-24 15:10:13 +02:00
Mark H Weaver
2095033b42 Fix documentation of R6RS 'binary-port?' to reflect reality.
* doc/ref/r6rs.texi (rnrs io ports): Improve the descriptions of
'binary-port?' and 'textual-port?'.
* module/rnrs/io/ports.scm (binary-port?, textual-port?): Update the
docstrings.
2019-06-18 03:09:42 -04:00
Mark H Weaver
cc73c2ab5d Add get-bytevector-some!.
* libguile/r6rs-ports.c (scm_get_bytevector_some_x): New procedure.
* libguile/r6rs-ports.h (scm_get_bytevector_some_x): Add prototype.
(scm_unget_bytevector): Move prototype next to 'scm_get_bytevector_some_x'.
* module/ice-9/binary-ports.scm: Export 'get-bytevector-some!'.
* doc/ref/api-io.texi (Binary I/O): Document it.
2019-06-18 02:05:20 -04:00
Andy Wingo
9fd978ed7e Add bind-optionals instruction
* doc/ref/vm.texi (Function Prologue Instructions): Document new
  instruction.
* libguile/jit.c (compile_bind_optionals): New compiler.
* libguile/vm-engine.c (VM_NAME): New interpreter.
* module/system/vm/assembler.scm (opt-prelude): Emit bind-optionals as
  appropriate.
* module/system/vm/disassembler.scm (define-stack-effect-parser)
  (code-annotation): Handle bind-optionals.
2019-06-06 16:36:32 +02:00
Andy Wingo
6880ced4c2 Reference Lightening instead of GNU Lightning
* doc/ref/vm.texi (Just-In-Time Native Code): Update with link to
  Lightening.
2019-05-23 21:00:20 +02:00
Mark H Weaver
cca381ce17 Update user-visible copyright years.
* doc/ref/guile.texi: Update years in copyright notice.
* module/ice-9/command-line.scm (version-etc): Update 'copyright-year'.
* module/system/repl/common.scm (*version*): Update copyright years.
2019-05-23 17:40:59 +02:00
Daniel Llorens
347ec3f088 Support ~N in SRFI-19 string->date
* module/srfi/srfi-19.scm (fractional-integer-reader,
  make-fractional-integer-reader): From reference implementation.
  (reader-directives): Handle #\N, from reference implementation.
* test-suite/tests/srfi-19: Add tests for string->date ~N.
* doc/ref/srfi-modules.texi (string->date): Add line for ~N.
2019-05-23 17:14:27 +02:00
Mikael Djurfeldt
a83de07e35 Documentation fixes
* doc/ref/api-control:
* doc/ref/compiler.texi: Language fixes
* doc/ref/compiler ($kfun): Renamed argument clauses -> clause.
2019-05-23 17:14:21 +02:00
Mark H Weaver
e00563492a SRFI-19: Fix TAI->UTC conversions, leap second handling, etc.
Fixes <https://bugs.gnu.org/21911>.
Fixes <https://bugs.gnu.org/22034>.
Fixes <https://bugs.gnu.org/21902>.
Partially fixes <https://bugs.gnu.org/21904>.
Reported by Zefram <zefram@fysh.org>.

* doc/ref/srfi-modules.texi (SRFI-19 Introduction): Fix the definitions
of Julian Day and Modified Julian Day.  Give the correct full names of
UTC and TAI.
* module/srfi/srfi-19.scm: Import (srfi srfi-1).  Use modern Guile
keyword syntax in the 'define-module' form.
(leap-second-neg-delta): New procedure, derived from a similar procedure
in the latest upstream SRFI-19 reference implementation.
(priv:time-tai->time-utc!, time-tai->julian-day)
(time-monotonic->julian-day): Use 'leap-second-neg-delta'.
(local-tz-offset): Fix comment.
(leap-second?): Remove.
(tai-before-leap-second?): New procedure, derived from upstream SRFI-19.
(time-utc->date): Use 'define*' to handle the optional argument.  Remove
the leap second handling, following upstream SRFI-19.
(time-tai->date): Rewrite in terms of 'time-utc->date'.  Add special
leap second handling, following upstream SRFI-19.
(time-monotonic->date): Rewrite in terms of 'time-tai->date'.
(date->time-tai, date->time-monotonic): Add special leap second
handling, following upstream SRFI-19.
(directives): In the entry for the "~Y" escape in 'date->string', pad
the year field to 4 characters, following upstream SRFI-19.
* test-suite/tests/srfi-19.test: Add tests.
2019-05-23 17:13:03 +02:00
Chris Marusich
3c87313628 Clarify the manual's "Processes" section.
* doc/ref/posix.texi (Processes): Use the phrase "integer status value"
consistently, and add a cross-reference to the section of the glibc
manual that explains what it is.
2019-05-23 16:09:49 +02:00
Mark H Weaver
0c0a658c56 Improve the documentation for 'nil?'.
* libguile/boolean.c (scm_nil_p): Improve docstring.
* doc/ref/api-languages.texi (Nil): Add documentation for 'nil?', along
with a description of how Elisp interprets Scheme booleans and
end-of-list.
2019-05-23 15:53:55 +02:00
Ludovic Courtès
827e88b4b7 Define AT_SYMLINK_NOFOLLOW et al.
* libguile/posix.c (scm_init_posix): Define AT_SYMLINK_NOFOLLOW,
AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, and AT_EMPTY_PATH when available.
(scm_utime): Mention AT_SYMLINK_NOFOLLOW.
* doc/ref/posix.texi (File System): Update accordingly.
* test-suite/tests/posix.test ("utime")["AT_SYMLINK_NOFOLLOW"]: New test.
2019-05-23 15:43:28 +02:00
Mark H Weaver
423ad3632f Update user-visible copyright years.
* doc/ref/guile.texi: Update years in copyright notice.
* module/ice-9/command-line.scm (version-etc): Update 'copyright-year'.
* module/system/repl/common.scm (*version*): Update copyright years.
2019-04-16 16:54:55 -04:00
Daniel Llorens
f74cfce4f1 Support ~N in SRFI-19 string->date
* module/srfi/srfi-19.scm (fractional-integer-reader,
  make-fractional-integer-reader): From reference implementation.
  (reader-directives): Handle #\N, from reference implementation.
* test-suite/tests/srfi-19: Add tests for string->date ~N.
* doc/ref/srfi-modules.texi (string->date): Add line for ~N.
2018-12-11 22:44:34 +01:00
Mikael Djurfeldt
d81253b292 Documentation fixes
* doc/ref/api-control:
* doc/ref/compiler.texi: Language fixes
* doc/ref/compiler ($kfun): Renamed argument clauses -> clause.
2018-10-31 19:14:01 +01:00
Mikael Djurfeldt
1f6786db06 Another language fix
* doc/ref/vm.texi: Fix bad sentence.
2018-10-29 20:52:03 +01:00
Mikael Djurfeldt
52398d1db4 Language fix
* doc/ref/vm.texi: Fix bad sentence.
2018-10-29 16:00:44 +01:00
Mikael Djurfeldt
bb0860a0e5 Spelling fixes
* doc/ref/data-rep.texi: Spelling
* doc/ref/vm.texi: Spelling
2018-10-21 14:54:38 +02:00
Mark H Weaver
5106377a34 SRFI-19: Fix TAI->UTC conversions, leap second handling, etc.
Fixes <https://bugs.gnu.org/21911>.
Fixes <https://bugs.gnu.org/22034>.
Fixes <https://bugs.gnu.org/21902>.
Partially fixes <https://bugs.gnu.org/21904>.
Reported by Zefram <zefram@fysh.org>.

* doc/ref/srfi-modules.texi (SRFI-19 Introduction): Fix the definitions
of Julian Day and Modified Julian Day.  Give the correct full names of
UTC and TAI.
* module/srfi/srfi-19.scm: Import (srfi srfi-1).  Use modern Guile
keyword syntax in the 'define-module' form.
(leap-second-neg-delta): New procedure, derived from a similar procedure
in the latest upstream SRFI-19 reference implementation.
(priv:time-tai->time-utc!, time-tai->julian-day)
(time-monotonic->julian-day): Use 'leap-second-neg-delta'.
(local-tz-offset): Fix comment.
(leap-second?): Remove.
(tai-before-leap-second?): New procedure, derived from upstream SRFI-19.
(time-utc->date): Use 'define*' to handle the optional argument.  Remove
the leap second handling, following upstream SRFI-19.
(time-tai->date): Rewrite in terms of 'time-utc->date'.  Add special
leap second handling, following upstream SRFI-19.
(time-monotonic->date): Rewrite in terms of 'time-tai->date'.
(date->time-tai, date->time-monotonic): Add special leap second
handling, following upstream SRFI-19.
(directives): In the entry for the "~Y" escape in 'date->string', pad
the year field to 4 characters, following upstream SRFI-19.
* test-suite/tests/srfi-19.test: Add tests.
2018-10-20 17:23:39 -04:00
Chris Marusich
8cdd3a0773 Clarify the manual's "Processes" section.
* doc/ref/posix.texi (Processes): Use the phrase "integer status value"
consistently, and add a cross-reference to the section of the glibc
manual that explains what it is.
2018-10-14 17:57:50 -04:00
Mark H Weaver
b44f505f15 Improve the documentation for 'nil?'.
* libguile/boolean.c (scm_nil_p): Improve docstring.
* doc/ref/api-languages.texi (Nil): Add documentation for 'nil?', along
with a description of how Elisp interprets Scheme booleans and
end-of-list.
2018-10-14 01:37:37 -04:00
Andy Wingo
94e66d2384 Minor additional manual updates
* doc/ref/api-debug.texi (VM Hooks): Update for changes in VM hook API.
* doc/ref/guile.texi: Update copyright years.
* doc/ref/preface.texi (Contributors): Update.
2018-10-07 12:28:51 +02:00
Andy Wingo
a3b32f839b Add manual section on JIT compiler
* doc/ref/vm.texi (Just-In-Time Native Code): New section.
* doc/ref/compiler.texi (Extending the Compiler): Update.
2018-10-07 11:36:45 +02:00
Andy Wingo
6a243e1ba0 Update compiler.texi
* doc/ref/compiler.texi: Update for compiler changes in Guile 3.
2018-10-03 23:24:22 +02:00
Andy Wingo
4e8d27f0d1 Finish updating vm.texi
* doc/ref/compiler.texi (Bytecode): Update macro-assembler instructions,
  and move most of them to the instruction set reference.
* doc/ref/vm.texi (A Virtual Machine for Guile, VM Programs): Minor
  fixes.
(Instruction Set): Update for Guile 3 instruction set.
* libguile/vm-engine.c (vm_engine): Update a few instruction
  docstrings.
2018-09-30 16:08:40 +02:00
Andy Wingo
4c53593bbe Update "Variables and the VM"
* doc/ref/vm.texi (Variables and the VM): Update.
2018-09-28 12:24:06 +02:00
Andy Wingo
5e671cea02 Update "Stack Layout"
* doc/ref/vm.texi (Stack Layout): Update.
2018-09-28 12:15:58 +02:00