From 61ffa8466bbfa4ca8b13b442a3bd63ef9504a6da Mon Sep 17 00:00:00 2001
From: EuAndreh <eu@euandre.org>
Date: Wed, 30 Apr 2025 06:23:27 -0300
Subject: src/content/en/: Unpluralize collection names

---
 src/content/en/pastebin/2021/09/02/sicp-3-19.adoc | 33 +++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/content/en/pastebin/2021/09/02/sicp-3-19.adoc

(limited to 'src/content/en/pastebin/2021/09/02/sicp-3-19.adoc')

diff --git a/src/content/en/pastebin/2021/09/02/sicp-3-19.adoc b/src/content/en/pastebin/2021/09/02/sicp-3-19.adoc
new file mode 100644
index 0000000..166170f
--- /dev/null
+++ b/src/content/en/pastebin/2021/09/02/sicp-3-19.adoc
@@ -0,0 +1,33 @@
+= SICP exercise 3.19
+:categories: lisp programming-languages
+
+[source,scheme]
+----
+(define (cycle? l)
+  (define (rec l x)
+    (cond
+      ((null? x) false)
+      ((eq? l x) true)
+      (true (rec l (cdr x)))))
+  (rec l (cdr l)))
+----
+
+Sample interactive session:
+
+[source,scheme]
+----
+scheme@(guile-user)> (define true #t)
+scheme@(guile-user)> (define false #f)
+scheme@(guile-user)>
+(define (cycle? l)
+  (define (rec l x)
+    (cond
+      ((null? x) false)
+      ((eq? l x) true)
+      (true (rec l (cdr x)))))
+  (rec l (cdr l)))
+scheme@(guile-user)> (cycle? '(1 2 3))
+$9 = #f
+scheme@(guile-user)> (cycle? (make-cycle '(1 2 3)))
+$10 = #t
+----
-- 
cgit v1.2.3

