Created
April 29, 2010 09:28
the seasoned schemer, define?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun define-p (e) | |
(if (consp e) | |
(eq (car e) 'define))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (define? e) | |
(let ((kar (if (atom? e) | |
#f | |
(car e)))) | |
(eq? kar 'define))) | |
(define (define? e) | |
(eq? (if (pair? e) | |
(car e) | |
#f) 'define)) | |
(define (define? e) | |
(eq? (and (pair? e) | |
(car e)) 'define)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (define? e) | |
(cond | |
((atom? e) #f) | |
((atom? (car e)) | |
(eq? (car e)(quote define))) | |
(else #f))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment