all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuval Langer <yuval.langer@gmail.com>
To: 67847@debbugs.gnu.org
Subject: [bug#67847] An SRFI-133 package definition for Guile
Date: Sat, 16 Dec 2023 02:12:29 +0200	[thread overview]
Message-ID: <CAK0OjG1o-vq8-eSWmTTZ9Lm_9Dph5_V_dufQojNkjipHU1m9RA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

SRFI-133 defines vector operations in a manner compatible with the
R7RS Scheme standard.

Please review.

Many thanks,
Yuval Langer.

[-- Attachment #2: 0001-Add-an-SRFI-133-package-for-Guile.patch --]
[-- Type: text/x-patch, Size: 3473 bytes --]

From 6eab8139c573a39cfe61a04e0dc738da842f9aab Mon Sep 17 00:00:00 2001
Message-Id: <6eab8139c573a39cfe61a04e0dc738da842f9aab.1702685407.git.yuval.langer@gmail.com>
From: Yuval Langer <yuval.langer@gmail.com>
Date: Sat, 16 Dec 2023 02:09:20 +0200
Subject: [PATCH] Add an SRFI-133 package for Guile.

---
 gnu/packages/guile-xyz.scm | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index fcaf788d37..4cb15d769d 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3550,6 +3550,79 @@ structures.  This package re-uses the SRFI sample implementation.")
            ;; contains ISC code from the SRFI sample implementation
            license:isc))))
 
+(define-public guile-srfi-133
+  (package
+    (name "guile-srfi-133")
+    (version "0.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/scheme-requests-for-implementation/srfi-133")
+             (commit "db81a114cd3e23375f024baec15482614ec90453")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0a7srl72291yah0aj6rwddhj041v2spximhknjj7hczlparsrm7f"))))
+    (build-system guile-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases
+            %standard-phases
+          (add-after 'unpack 'move-create-and-delete-files
+            (lambda _
+              (rename-file "vectors" "srfi")
+              (rename-file "srfi/vectors-test.scm" "srfi/srfi-test.scm")
+              (rename-file "srfi/vectors-impl.scm" "srfi/srfi-impl.scm")
+              (with-output-to-file "srfi/srfi-133.scm"
+                (lambda ()
+                  (display "(define-module (srfi srfi-133)
+  #:replace (;; Constructors
+             vector-copy
+
+             ;; Mutators
+             vector-fill! vector-copy!
+
+             ;; Conversion
+             vector->list list->vector)
+  #:export (;; Constructors
+            vector-unfold vector-unfold-right vector-reverse-copy
+            vector-append vector-concatenate vector-append-subvectors
+
+            ;; Predicates
+            vector-empty? vector=
+
+            ;; Iteration
+            vector-fold vector-fold-right vector-map vector-map!
+            vector-for-each vector-count vector-cumulate
+
+            ;; Searching
+            vector-index vector-index-right vector-skip vector-skip-right
+            vector-binary-search vector-any vector-every vector-partition
+
+            ;; Mutators
+            vector-swap! vector-reverse!
+            vector-reverse-copy! vector-unfold! vector-unfold-right!
+
+            ;; Conversion
+            reverse-vector->list reverse-list->vector
+            vector->string string->vector))
+
+(include \"srfi-impl.scm\")")))
+              (for-each (lambda (filename)
+                          (delete-file filename))
+                        '("tests/run.scm"
+                          "srfi/vectors.sld"
+                          "srfi/vectors.scm")))))))
+    (native-inputs
+     (list guile-3.0))
+    (home-page "https://github.com/scheme-requests-for-implementation/srfi-133")
+    (synopsis "Vector Library (R7RS-compatible)")
+    (description
+     "A comprehensive library of vector operations.")
+    (license license:expat)))
+
 (define-public guile-srfi-145
   (package
     (name "guile-srfi-145")
-- 
2.30.2


             reply	other threads:[~2023-12-16  2:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16  0:12 Yuval Langer [this message]
2024-01-05 16:15 ` bug#67847: An SRFI-133 package definition for Guile Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK0OjG1o-vq8-eSWmTTZ9Lm_9Dph5_V_dufQojNkjipHU1m9RA@mail.gmail.com \
    --to=yuval.langer@gmail.com \
    --cc=67847@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.