Release 0.9.13


Partial support of SRFI-226 (Control Features)

"Control Features" SRFI (srfi:226) clarifies interactions between threads, dynamic environment, and (partial) continuations. It is a large srfi and we haven't completely supported it yet, though some of it is already available in this release.

Although the srfi is a compatible extension to R7RS, some of it is incompatible with the way Gauche has extended R7RS. Notably, parameters behave differently. We're switching to SRFI-226 semantics, though in this release the built-in API behaves in the compatibility mode. The manual section Parameters and dynamic states explains the changes in detail, though here's a short summary:

SRFI module naming convention

We named srfi module as srfi-N; which was the tradition before R6RS. Modern Scheme uses a list to name libraries, and srfis are named like (srfi N) in R7RS, which translates to srfi.N in Gauche's way. So there are following variations:

We've been using srfi-N throught documentation by 0.9.12. From 0.9.13, we make srfi.N official for Gauche code. srfi-N still works and will keep working. (Internally, we used to have code in srfi-N.scm and srfi/N.scm merely referred to it. They are switched in this release.)

We also recommend to use (library srfi.N) (Gauche specific) or (library (srfi N)) (portable R7RS) in the cond-expand feature test clause, instead of srfi-N feature identifier.

;; Legacy way
(cond-expand
  (srfi-114
    ;; code assuming SRFI-114
    )
  (else ...))

;; Recommended
(cond-expand
  ((library srfi.114)
   (use srfi.114)
    ;; code assuming SRFI-114
   )
  (else ...))

;; Recommended (R7RS portabile)
(cond-expand
  ((library (srfi 114))
   (import (srfi 114))
    ;; code assuming SRFI-114
   )
  (else ...))

The legacy way was the only way until library clause was introduced in R7RS. Now using library is the preferred way. The legacy way conflates feature test and library import, which can have a pitfall. For example, SRFI-101 redefines lots of Scheme primitive operators. Using the legacy way to test srfi-101 availability triggers loading srfi.101 into the current module, which shadows those primitive operators. Most of the time that's not what you want. Using the new way, you can import srfi.101 identifiers with prefix or renaming so that they won't conflict with R7RS primitives.

If you set the enviornment variable GAUCHE_WARN_SRFI_FEATURE_ID, Gauche warns if it sees srfi-N feature identifiers. We'll make it default in future versions.

Improvements on interactive development

Utility script naming convention

Gauche comes with several Scheme scripts, such as precomp for ahead-of-time compilation. They used to be installed in the toplevel library directory so that they can be invoked as gosh precomp etc. However, as the number of such scripts grow, the library directory will get cluttered. So we now install those scripts in tools directory, e.g. you can invoke it as gosh tools/precomp. For easier transition, the original path still works but a warning is printed. We'll drop this compatibily feature in future, so rewrite your Makefiles whenever you see the warning.

Real-domain elementary functions

Added whole bunch of real-* functions (e.g. real-exp) that work only for real numbers. They are faster than the generic (complex) version and preferable in a speed-sensitive code. See Real numerical functions.

We had undocumented real-domain functions such as %exp. They were intended to be internal building blocks and not to be used directly. However, they were visible from gauche module so some existing code may be using them. A compatibility module compat.real-elementary-functions is available for transition.

format enhancement

A bunch of new directives are new recognized by format.

Digest framework update

The old API uses incomplete strings as octed sequences, which is gradually superseded by u8vectors (bytevectors) now. We revised their interface so that they use u8vector for octet streams, and allows to obtain the decoded result as either a string or a u8vector.

The old API still works, but deprecated.

Affected modules are as follows: rfc.hmac, util.digest, rfc.base64, rfc.quoted-printable.

Here's the new naming convention.

Also, rfc.base64 is updated to support RFC4648; it has an option to omit padding, and also base32 and base16 encodings are supported.

New SRFIs, modules and procedures

New SRFIs

New modules

New procedures/macros

Miscellaneous additions

Deprecating some configure options

Bug fixes


Last modified : 2024/01/22 18:34:24 UTC