No description
  • Scheme 91.6%
  • Shell 4.5%
  • Makefile 2.4%
  • M4 1.5%
Find a file
Giacomo Leidi e77ee9c89f
Rename module to (guix-lib guix records).
The 'guix-lib prefix has been added both to disambiguate between (guix
records) mainline and this version and because it may be adopted by
other similar efforts for Guix internal libraries extracted as standalone.

Import (guix records) from ed6dfa0129

* .gitignore: Allow files named /guix-* .
* ChangeLog: Correct repository URL.
* README.md: Rename and clarify development process.
* configure.ac: Apply rename.
* .guix/modules/guile-guix-records.scm: Rename to...
* .guix/modules/guix-lib-guix-records.scm: ...and rename package.
* scripts/update_source.sh: Apply rename.
* guix.scm: Link to new file.
* guix/records.scm: Rename to...
* guix-lib/guix/records.scm: ...and sync with upstream.
* tests/records.scm: Rename to...
* tests/guix/records.scm: ...and sync with upstream.
2026-06-22 22:05:51 +02:00
.guix/modules Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
build-aux Init 2026-06-10 20:59:13 +02:00
guix-lib/guix Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
scripts Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
tests/guix Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
.gitignore Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
.guix-channel Make repository a Guix channel. 2026-06-10 20:59:13 +02:00
AUTHORS Init 2026-06-10 20:59:13 +02:00
ChangeLog Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
configure.ac Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
COPYING Init 2026-06-10 20:59:13 +02:00
guix.scm Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
Makefile.am Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00
NEWS Init 2026-06-10 20:59:13 +02:00
README Init 2026-06-10 20:59:13 +02:00
README.md Rename module to (guix-lib guix records). 2026-06-22 22:05:51 +02:00

Guix' declarative record system, as a standalone Guile library

guix-lib-guix-records packages the (guix-lib guix records) module, Guix's declarative record system defined at guix/records.scm, as a standalone Guile library. It lets Guile projects use declarative, functional records without depending on the full Guix.

What it provides

The (guix-lib guix records) module exports:

  • define-record-type*: an extension of SRFI-9's record definition form with named field initializers, default values, thunked/delayed/innate/sanitized fields, and a functional (inherit …) copy form.
  • this-record: refers to the surrounding record from within a thunked field expression.
  • alist->record: build a record from an association list.
  • object->fields: print a record's fields to a port.
  • recutils->alist: parse a recutils-style stanza into an association list.
  • match-record, match-record-lambda: destructure records by field name.
(use-modules (guix-lib guix records))

(define-record-type* <person> person make-person
  person?
  (name      person-name (default "sara"))
  (speak-to  person-speak-to (default (current-output-port)) (thunked)))

(define a-person
  (person (name "rufy")))                   ;=> #<<person> name: "foo" ...>

(define another-person
  (person (inherit a-person)
         (name "nami"))                     ;functional update

A note on support

This library is merely a periodic export of (guix records). All development happens in Guix mainline, this is just an experiment to allow using parts of Guix in Guile programs other than Guix. The API is bound to Guix' needs and will change any time it changes in Guix mainline. In case you find bugs specific to how the module renaming affects the library report them here.

Building from source

Guix

guix build -f guix.scm

Autotools

To use autotools you need the following dependencies:

  • autoconf
  • automake
  • guile
  • make
  • pkg-config

then you can run:

autoreconf -vif
./configure
make

Running the test suite

make check

Guix channel

The repository is also a Guix channel. To add it to your ~/.config/guix/channels.scm:

(cons* (channel
        (name 'guix-records)
        (url "https://codeberg.org/fishinthecalculator/guix-records.git")
        (branch "main"))
       %default-channels)

After guix pull the package guix-lib-guix-records.git will be available.

Licence

Files in this repository are distributed under the terms of the GNU GPL version 3 or later, matching Guix mainline.