[PATCH] gnu: Add guile-srfi-197.

  • Done
  • quality assurance status badge
Details
2 participants
  • Mathieu Othacehe
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 1 years ago
(address . guix-patches@gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
021a14380a3d701f4dddbac72b83bf34bdea4558.1704640177.git.~@wolfsden.cz
* gnu/packages/guile-xyz.scm (guile-srfi-197): New variable.

Change-Id: Ifcdc264e6a03e88e7614d79792fbe6ca9c8e519c
---
gnu/packages/guile-xyz.scm | 56 ++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)

Toggle diff (71 lines)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 75e3754046..ff3104a407 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3840,6 +3840,62 @@ (define-public guile-srfi-189
or errors (Left).")
(license license:expat))))
+(define-public guile-srfi-197
+ (let ((commit "d31b8be86460bf837cccf2737a1b9b9c01788573")
+ (revision "0"))
+ (package
+ (name "guile-srfi-197")
+ (version (git-version "0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/scheme-requests-for-implementation/srfi-197")
+ (commit commit)))
+ (sha256
+ (base32
+ "1c1jjzqgavjwfzs352wssdbjga5ymv4g3lkl0zxhjw7pfrr5xx1m"))
+ (file-name (git-file-name name version))))
+ (build-system guile-build-system)
+ (arguments
+ (list
+ #:source-directory "src"
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'create-module
+ (λ _
+ (use-modules (ice-9 textual-ports))
+ (mkdir-p "src/srfi")
+ (call-with-output-file "src/srfi/srfi-197.scm"
+ (λ (port)
+ (write '(define-module (srfi srfi-197)
+ #:use-module (scheme base)
+ #:export (chain
+ chain-and
+ chain-when
+ chain-lambda
+ nest
+ nest-reverse))
+ port)
+ (call-with-input-file "srfi-197-syntax-case.scm"
+ (λ (in-port)
+ (display (get-string-all in-port) port)))))))
+ (add-after 'install 'check-installed
+ (λ _
+ (define-values (scm go) (target-guile-scm+go #$output))
+ (invoke "guile" "-L" scm "-C" go
+ "--use-srfi=197" "./test.scm"))))))
+ (native-inputs
+ (list guile-3.0))
+ (home-page "https://srfi.schemers.org/srfi-197/")
+ (synopsis "Pipeline operators for Guile")
+ (description
+ "This library provides a reference implementation for SRFI-197. This
+SRFI defines a family of chain and nest pipeline operators, which can rewrite
+nested expressions like (a b (c d (e f g))) as a sequence of operations:
+(chain g (e f _) (c d _) (a b _)).")
+ (license license:expat))))
+
(define-public guile-srfi-232
(package
(name "guile-srfi-232")

base-commit: b212e6934643e085f168a5364cb593f61aa616ba
--
2.41.0
Mathieu Othacehe wrote 1 years ago
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 68305@debbugs.gnu.org)
87mstar0qd.fsf@gnu.org
Hello,

Toggle quote (4 lines)
> +(define-public guile-srfi-197
> + (let ((commit "d31b8be86460bf837cccf2737a1b9b9c01788573")
> + (revision "0"))

You should explain why you are not using a release with a comment. The
"final" tag for instance.

Toggle quote (4 lines)
> + #~(modify-phases %standard-phases
> + (add-after 'unpack 'create-module
> + (λ _

Please use 'lambda'.

Toggle quote (3 lines)
> +SRFI defines a family of chain and nest pipeline operators, which can rewrite
> +nested expressions like (a b (c d (e f g))) as a sequence of operations:

@code{(a b (c d (e f g)))}

Toggle quote (2 lines)
> +(chain g (e f _) (c d _) (a b _)).")

@code{(chain g (e f _) (c d _) (a b _)).")}

Can you please send a v2?

Thanks,

Mathieu
Tomas Volf wrote 1 years ago
[PATCH v2] gnu: Add guile-srfi-197.
(address . 68305@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
7e2b8cc933f8ba17e5ccb97ddc4c3f6d8e386e9b.1705077961.git.~@wolfsden.cz
* gnu/packages/guile-xyz.scm (guile-srfi-197): New variable.

Change-Id: Ifcdc264e6a03e88e7614d79792fbe6ca9c8e519c
---
* Use lambda instead of λ.
* Add comment regarding the commit used.
* Use @code{} in the description.

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

Toggle diff (74 lines)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 75e3754046..841127e8c9 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3840,6 +3840,65 @@ (define-public guile-srfi-189
or errors (Left).")
(license license:expat))))
+(define-public guile-srfi-197
+ (let (
+ ;; There is minor fix to the documention after the final tag, so use
+ ;; the newest commit instead.
+ (commit "d31b8be86460bf837cccf2737a1b9b9c01788573")
+ (revision "0"))
+ (package
+ (name "guile-srfi-197")
+ (version (git-version "0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/scheme-requests-for-implementation/srfi-197")
+ (commit commit)))
+ (sha256
+ (base32
+ "1c1jjzqgavjwfzs352wssdbjga5ymv4g3lkl0zxhjw7pfrr5xx1m"))
+ (file-name (git-file-name name version))))
+ (build-system guile-build-system)
+ (arguments
+ (list
+ #:source-directory "src"
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'create-module
+ (lambda _
+ (use-modules (ice-9 textual-ports))
+ (mkdir-p "src/srfi")
+ (call-with-output-file "src/srfi/srfi-197.scm"
+ (lambda (port)
+ (write '(define-module (srfi srfi-197)
+ #:use-module (scheme base)
+ #:export (chain
+ chain-and
+ chain-when
+ chain-lambda
+ nest
+ nest-reverse))
+ port)
+ (call-with-input-file "srfi-197-syntax-case.scm"
+ (lambda (in-port)
+ (display (get-string-all in-port) port)))))))
+ (add-after 'install 'check-installed
+ (lambda _
+ (define-values (scm go) (target-guile-scm+go #$output))
+ (invoke "guile" "-L" scm "-C" go
+ "--use-srfi=197" "./test.scm"))))))
+ (native-inputs
+ (list guile-3.0))
+ (home-page "https://srfi.schemers.org/srfi-197/")
+ (synopsis "Pipeline operators for Guile")
+ (description
+ "This library provides a reference implementation for SRFI-197. This
+SRFI defines a family of chain and nest pipeline operators, which can rewrite
+nested expressions like @code{(a b (c d (e f g)))} as a sequence of
+operations: @code{(chain g (e f _) (c d _) (a b _))}.")
+ (license license:expat))))
+
(define-public guile-srfi-232
(package
(name "guile-srfi-232")

base-commit: b212e6934643e085f168a5364cb593f61aa616ba
--
2.41.0
Tomas Volf wrote 1 years ago
Re: [bug#68305] [PATCH] gnu: Add guile-srfi-197.
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 68305@debbugs.gnu.org)
ZaFtFHFTwS3Z4Y-K@ws
On 2024-01-12 17:10:50 +0100, Mathieu Othacehe wrote:
Toggle quote (10 lines)
>
> Hello,
>
> > +(define-public guile-srfi-197
> > + (let ((commit "d31b8be86460bf837cccf2737a1b9b9c01788573")
> > + (revision "0"))
>
> You should explain why you are not using a release with a comment. The
> "final" tag for instance.

Comment added.

Toggle quote (7 lines)
>
> > + #~(modify-phases %standard-phases
> > + (add-after 'unpack 'create-module
> > + (λ _
>
> Please use 'lambda'.

I replaced all occurrences. Is there something regarding this in the manual? I
see no mention of it and guix style leaves it as it is. There are few (~5) uses
in the repository already, so I assumed it is permitted.

Toggle quote (12 lines)
>
> > +SRFI defines a family of chain and nest pipeline operators, which can rewrite
> > +nested expressions like (a b (c d (e f g))) as a sequence of operations:
>
> @code{(a b (c d (e f g)))}
>
> > +(chain g (e f _) (c d _) (a b _)).")
>
> @code{(chain g (e f _) (c d _) (a b _)).")}
>
> Can you please send a v2?

Done and done.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWhbRQACgkQL7/ufbZ/
wamiVRAAn9BtHvVGVbhdXYC9LDjje3dr7kk3ir5dCV3pBA+QbEFwZOpcKV7fAegp
MiEF1rImOnB8G49capNb28cpFPHA6PtOxrn393z/lBD6Tgt+Ppja/4Zo7hhF3qST
XTOym06QDZ41ofWuX812GqU28Y6EelcAO/ZYqAGAiDF7HwjDOeOKR9bWRd1AnWCS
YXZ6LSI1lMSpzXsBi+/yvM7bd7vfjsiRbQRBZzUIoDVFmzOzGQleReNOQvtwCYDf
ATnNNqHK4NoWrYbisin36QlVRK3+welSzHkxLPE1RL4hNK3Vo/Ri9M+vCpKy2Szh
f2UBpeNKc3ShviLeiT1deI7127zjT6jge2NXSEFH5FmPeKQAS4Dv0kql+Z2bCNNQ
ViQam9JPxG6avz46dkNV3u6xfCbFzaJNA1mcplhpTDV9MpjUCMGyCXtDHaItv9Yg
HNrtOdXp3JH9I1XdLSUZPpX8CcIK9InGAfZr9rgqKKnskDAZKFMXYICEM7pUx2mP
IahaJZGozd7yH2wXGdxBegvdqd2ZuU+fk/83szJyUGUqlPrUu4aRTjKKHB3+UuUp
F+ahNrNAB4kgnWWsJ9WsVnvYww2bEnV/73NGenadSYPQBfSsA31SIOupAczQ9tOi
lH3nySKHzb/IaeR248plHyIVEkNVhewaDJXgSaf8Lq2MU99s5t4=
=xIzp
-----END PGP SIGNATURE-----


Mathieu Othacehe wrote 1 years ago
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 68305@debbugs.gnu.org)
87il3xio3w.fsf@gnu.org
Hey,

Toggle quote (4 lines)
> I replaced all occurrences. Is there something regarding this in the manual? I
> see no mention of it and guix style leaves it as it is. There are few (~5) uses
> in the repository already, so I assumed it is permitted.

I don't think it is advised not to use that anywhere but the reason to
me is the consistency of the code base. It would be nice to remove the 5
existing use that you are reporting :)

Toggle quote (2 lines)
> Done and done.

Perfect, thanks,

Mathieu
Mathieu Othacehe wrote 1 years ago
Re: [bug#68305] [PATCH v2] gnu: Add guile-srfi-197.
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 68305-done@debbugs.gnu.org)
87zfx9h8pr.fsf@gnu.org
Toggle quote (2 lines)
> * gnu/packages/guile-xyz.scm (guile-srfi-197): New variable.

Applied, thanks!

Mathieu
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 68305@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68305
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help