Skip to content

Instantly share code, notes, and snippets.

@mugyu
Created March 11, 2012 07:12
Show Gist options
  • Save mugyu/2015387 to your computer and use it in GitHub Desktop.
Save mugyu/2015387 to your computer and use it in GitHub Desktop.
Schemeで等価述語以外の述語の例
(pair? '(1)) ; => #t
(null? '()) ; => #t
(list? (list)) ; => #t
(boolean? #f) ; => #t
(symbol? 'example) ; => #t
(number? 1) ; => #t
(char? #\a) ; => #t
(string? "string") ; => #t
(odd? 1) ; => #t
(even? 2) ; => #t
(zero? 0) ; => #t
(char-alphabetic? #\a) ; => #t
(proper-list? '(1 2)) ; => #t
(proper-list? '(1 . 2)) ; => #f
(any odd? '(1 2)) ; => #t
(any odd? '(2 4)) ; => #f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment