Skip to content

Instantly share code, notes, and snippets.

@mugyu
Created March 10, 2012 21:25
Show Gist options
  • Save mugyu/2013285 to your computer and use it in GitHub Desktop.
Save mugyu/2013285 to your computer and use it in GitHub Desktop.
schemeで等価述語の例
(equal? (list 1 2 3) (list 1 2 3)) ; => #t
((lambda (p) (eq? p p)) (cons 1 2)) ; => #t
(eq? 'example 'example) ; => #t
(eqv? 1 1) ; => #t
(eqv? 1 1.0) ; => #f
(= 1 1.0) ; => #t
(char=? #\a #\a) ; => #t
(string=? "example" "example") ; => #t
(char-ci=? #\a #\A) ; => #t
(string-ci=? "example" "EXAMPLE") ; => #t
(not #f) ; => #t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment