-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO
170 lines (139 loc) · 3.65 KB
/
TODO
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
- Ledgend:
[] -- means TODO
[?] -- means partial implementation
[X] -- means done! (please remove from this file)
[C] -- means control flow related, see below
[S] -- means syntax-rules related
[D] -- means syntax-rules dependant
[L] -- means define-library related
[R] -- means research
- Numbers
[X] arithmetic functions
[?] trigonometric functions, TODO: must accept integers
[?] type promotion [AJR]
[?] number->string, TODO: optional parameters
[] inexact->exact
[] exact->inexact
---
[] test suite [AJR]
- Syntax
[X] (define-syntax)
[X] (let-syntax)
[?] (letrec-syntax), TODO: make recursive
[?] syntax-error, TODO: differentiate from (error)
[X] (syntax-rules)
[] (syntax-case) -- low priority
---
[X] Label these as [S] for syntax or [D] for dependant on syntax-rules
[] research
[] see if (define-record-type) can be derived syntax
[] (a ...) works, but ((a b) ...) doesn't
[] let loop -- this should be builtin
(let-syntax ((foo (syntax-rules () ((_) (list "foo"))))) (foo))
=> '("foo")
- Control flow
[] (call/cc)
[] (dynamic-wind)
[] (guard)
[] (with-exception-handler)
---
[X] Label these as [C] for control
[?] raise-continuable -- may be revisited
[] research
- Library support
[] cond-expand
[] define-library (R7RS)
[] library (R6RS)
[] import -- for programs
---
[X] Label these as [L] for library
[] research snow
- Record support
[] define-record-type
---
[] test suite
(define x 3)
(define-syntax foo (syntax-rules () ((foo) x)))
(define x 4)
(foo)
(/ (/ -1.0 0.0))
(define (assert x) (if x #t (error "Assert fail")))
- Hash Tables (from R6RS, and perhaps R7RS-large)
[?] hashtable-mutable?, TODO: immutability
[] list->hashtable -- equal? based
[] vector->hashtable -- equal? based
[] test suite [AJR]
- (scheme base) R7RS
If you don't see the function here, then it means
that it's been implemented (at least partially)
[C] call/cc
[X] call/ec
[D] case-lambda -- requires syntax-rules
[L] cond-expand
[R] define-record-type
[L] define-library/library
[D] do
[C] dynamic-wind
[C] guard
[L] import -- for programs
[X] parameterize
[C] with-exception-handler
(cons i list) a bcd
(list i i i i) a b c d
(list* i i i list) a b cd
(list+ list i i i) ab c d
(listr list i) abc d
(append list list list)
(define (most ls)
(if (null? ls) ()
(if (null? (cdr ls)) ()
(cons (car ls) (most (cdr ls))))))
(define (append a . rest)
(if (null? rest) a
(fold-right cons (apply append rest) a)))
(define (list* . rest)
(if (list? rest)
(apply apply list rest)))
(define (list+ a . rest)
(if (list? a)
(append a rest)))
(cons (car ls) (cdr ls)) == ls
(car (cons x y)) == x
(cdr (cons x y)) == y
- Guile compatibility
[]
- MIT-Scheme compatibility
[X] rationalize->exact
[X] simplest-rational->exact
[X] simplest-rational
- Racket compatibility
[X] andmap
[X] ormap
- Other
[] char-ci=?
[X] empty?
[X] inexact=?
[X] pointer=?
[] string-ci=?
[X] symbol-ci=?
[X] symbol=?
[] make Seq interface
- List of dependancies
fold-left : case-lambda
fold-right : case-lambda
case-lambda : syntax-rules
- Macros
(and #t (begin (display "hello") #t))
(and #t (begin (display "hello") #f))
(and #f (begin (display "hello") #t))
(and #f (begin (display "hello") #f))
(define-macro (and . rest)
`(if (null? (list ,@rest)) #t
(if (car (list ,@rest))
(and ,@(cdr (list ,@rest)))
#f)))
(define-macro (or . rest)
`(if (null? (list ,@rest)) #f
(if (car (list ,@rest))
#t
(or ,@(cdr (list ,@rest))))))