Created
August 23, 2018 12:14
-
-
Save theodesp/cbbcf2aac934763a652bc40a0344e8e6 to your computer and use it in GitHub Desktop.
Is Leap year #scheme
This file contains hidden or 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
(import (rnrs (6))) | |
(use-modules ((rnrs) :version (6))) | |
(define (leap-year? year) | |
(if (and (divisible? year 4) (not (divisible? year 100))) | |
#t | |
(if (divisible? year 400) | |
#t | |
#f))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you only need to provide the
divisible?
functionand skip the imports in the beginning. I think they only work for guile scheme