Skip to content

Commit 272988a

Browse files
committed
crook
1 parent fbac811 commit 272988a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

iniquity-plus/parse.rkt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
[(list ys gs (Prog ds e))
7070
(list ys gs (Prog (cons d ds) e))])])]))
7171

72-
7372
;; S-Expr [Listof Id] [Listof Id] [Listof Id] [Listof Id] -> (list [Listof Id] [Listof Id] Defn)
7473
;; s: definition shaped s-expr to be parsed
7574
;; fs: defined function names
@@ -213,6 +212,7 @@
213212
(list ys gs (cons e es))])])]
214213
[_ (error "parse error")]))
215214

215+
;; [Listof Any] -> Boolean
216216
(define (distinct? xs)
217217
(not (check-duplicates xs)))
218218

@@ -223,13 +223,13 @@
223223
[(cons x xs) (and (p? x) (all p? xs))]
224224
[x (p? x)]))
225225

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))))
229230
(define (in m)
230231
(λ (x) (memq x m)))
231232

232-
233233
;; Any -> Boolean
234234
(define (datum? x)
235235
(or (exact-integer? x)

knock-plus/parse.rkt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,17 @@
257257
(list ys xs gs (cons p ps))])])]
258258
[_ (error "match: bad syntax")]))
259259

260+
;; [Listof Any] -> Boolean
260261
(define (distinct? xs)
261262
(not (check-duplicates xs)))
262263

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))))
266268
(define (in m)
267269
(λ (x) (memq x m)))
268270

269-
270271
;; Any -> Boolean
271272
(define (datum? x)
272273
(or (exact-integer? x)

0 commit comments

Comments
 (0)