Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; [List-of X] X -> number or error
- ; Count number of elements to X
- (define (cnt l x)
- (cond
- [(empty? l) (error x "not found")]
- [(symbol=? (first l) x) 0]
- [else (add1 (cnt (rest l) x))]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement