Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Detecting the caller of a function in Scheme or Racket
- (define atom? (lambda (x) (and (not (pair? x)) (not (empty? x)))))
- (define lat? (lambda (l)
- (define latt?
- (lambda (l)
- (cond
- ((null? l) #t)
- ((atom? (car l)) (latt? (cdr l)))
- (else #f))))
- (if (null? l) #f (latt? l))))
- (define lat?
- (lambda (l)
- (cond
- ((and (null? l) (called-by "lat?")) #t)
- ((atom? (car l)) (lat? (cdr l)))
- (else #f))))
Add Comment
Please, Sign In to add comment