aboutsummaryrefslogtreecommitdiff

title: SICP exercise 3.19

date: 2021-09-02

categories: lisp programming-languages


Some content here, before:

(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:

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

An h1

a list:

  1. one
  2. two
  3. three

some content.

  • item
  • another
  • yet another

An h2

Xablau:

xupliu 1

3
4





dez

Foi wikiwiu.

a very long code block:

wef
wef               wef            wef       wef
wef                                                   wef       wef wef we fwef                wef wef wef            wef 

Someone said:

Xablau, xupliu.

A repeated header

A repeated header

a big list:

  1. a
  2. a
  3. a
  4. a
  5. a
  6. a
  7. a
  8. a
  9. a
  10. a
  11. a
  12. a
  13. a
  14. a
  15. a
  16. a
  17. a
  18. a