File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 69
69
[(list ys gs (Prog ds e))
70
70
(list ys gs (Prog (cons d ds) e))])])]))
71
71
72
-
73
72
;; S-Expr [Listof Id] [Listof Id] [Listof Id] [Listof Id] -> (list [Listof Id] [Listof Id] Defn)
74
73
;; s: definition shaped s-expr to be parsed
75
74
;; fs: defined function names
213
212
(list ys gs (cons e es))])])]
214
213
[_ (error "parse error " )]))
215
214
215
+ ;; [Listof Any] -> Boolean
216
216
(define (distinct? xs)
217
217
(not (check-duplicates xs)))
218
218
223
223
[(cons x xs) (and (p? x) (all p? xs))]
224
224
[x (p? x)]))
225
225
226
- ;; [Listof Any] -> (Any -> Boolean)
227
- (define (not-in m)
228
- (λ (x) (not (memq x m))))
226
+ ;; xs:[Listof Any] -> p:(x:Any -> Boolean)
227
+ ;; Produce a predicate p for things not in xs
228
+ (define (not-in xs)
229
+ (λ (x) (not (memq x xs))))
229
230
(define (in m)
230
231
(λ (x) (memq x m)))
231
232
232
-
233
233
;; Any -> Boolean
234
234
(define (datum? x)
235
235
(or (exact-integer? x)
Original file line number Diff line number Diff line change 257
257
(list ys xs gs (cons p ps))])])]
258
258
[_ (error "match: bad syntax " )]))
259
259
260
+ ;; [Listof Any] -> Boolean
260
261
(define (distinct? xs)
261
262
(not (check-duplicates xs)))
262
263
263
- ;; [Listof Any] -> (Any -> Boolean)
264
- (define (not-in m)
265
- (λ (x) (not (memq x m))))
264
+ ;; xs:[Listof Any] -> p:(x:Any -> Boolean)
265
+ ;; Produce a predicate p for things not in xs
266
+ (define (not-in xs)
267
+ (λ (x) (not (memq x xs))))
266
268
(define (in m)
267
269
(λ (x) (memq x m)))
268
270
269
-
270
271
;; Any -> Boolean
271
272
(define (datum? x)
272
273
(or (exact-integer? x)
You can’t perform that action at this time.
0 commit comments