aboutsummaryrefslogtreecommitdiff
path: root/v2/src/content/en/pastebins/sicp-exercise-3-19.md
blob: 3188dce08ba8339b3623f464c0d286bed66f10ae (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---

title: SICP exercise 3.19

date: 2021-09-02

---

Some content here, before:

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

```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
```

# 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
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a
1. a