unofficial mirror of 
 help / color / mirror / Atom feed
* patch to augment and=>
@ 2020-07-05  9:47 Christopher Lam
  0 siblings, 0 replies; only message in thread
From: Christopher Lam @ 2020-07-05  9:47 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1.1: Type: text/plain, Size: 66 bytes --]

Hi guilers!
Is this of any interest to merge into boot.scm?

[-- Attachment #1.2: Type: text/html, Size: 122 bytes --]

[-- Attachment #2: and-arrow.patch --]
[-- Type: text/x-patch, Size: 691 bytes --]

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 0d37f3d48..edb7e93cc 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -803,9 +803,13 @@ VALUE."
   (lambda _
-(define (and=> value procedure)
-  "When VALUE is #f, return #f.  Otherwise, return (PROC VALUE)."
-  (and value (procedure value)))
+(define (and=> value . procedures)
+  "When VALUE is #f, return #f.  Otherwise, return (PROC VALUE). Recurse
+with subsequent procedures."
+  (if (null? procedures)
+      value
+      (let ((result ((car procedures) value)))
+        (and result (apply and=> result (cdr procedures))))))
 (define call/cc call-with-current-continuation)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-05  9:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05  9:47 patch to augment and=> Christopher Lam

unofficial mirror of 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror guile-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-devel guile-devel/ \
	public-inbox-index guile-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git