More month comparison functions.
This commit is contained in:
parent
00e2cab0ae
commit
922b178519
2 changed files with 22 additions and 3 deletions
|
@ -91,16 +91,19 @@ Functional Modules
|
||||||
|
|
||||||
### Member Base
|
### Member Base
|
||||||
|
|
||||||
|
Specific Support Modules
|
||||||
|
------------------------
|
||||||
|
|
||||||
### Month
|
### Month
|
||||||
|
|
||||||
### Period
|
### Period
|
||||||
|
|
||||||
### Primes
|
### Primes
|
||||||
|
|
||||||
Support Modules
|
Generic Support Modules
|
||||||
---------------
|
-----------------------
|
||||||
|
|
||||||
There modules are not specific to this project but had to be
|
These modules are not specific to this project but had to be
|
||||||
implemented anyway to not require any external dependencies.
|
implemented anyway to not require any external dependencies.
|
||||||
|
|
||||||
### ANSI
|
### ANSI
|
||||||
|
|
16
month.scm
16
month.scm
|
@ -34,6 +34,9 @@
|
||||||
month->string
|
month->string
|
||||||
month=?
|
month=?
|
||||||
month<?
|
month<?
|
||||||
|
month<=?
|
||||||
|
month>=?
|
||||||
|
month>?
|
||||||
month-diff
|
month-diff
|
||||||
month-add
|
month-add
|
||||||
month-tests!
|
month-tests!
|
||||||
|
@ -108,6 +111,19 @@
|
||||||
(and (= (car m) (car n))
|
(and (= (car m) (car n))
|
||||||
(< (cadr m) (cadr n))))))
|
(< (cadr m) (cadr n))))))
|
||||||
|
|
||||||
|
;; Returns true if m is less than or equal n
|
||||||
|
(define (month<=? m n)
|
||||||
|
(or (month<? m n)
|
||||||
|
(month=? m n)))
|
||||||
|
|
||||||
|
;; Returns true if m is greater than or equal to n
|
||||||
|
(define (month>=? m n)
|
||||||
|
(not (month<? m n)))
|
||||||
|
|
||||||
|
;; Returns true if m is greater than n
|
||||||
|
(define (month>? m n)
|
||||||
|
(not (month<=? m n)))
|
||||||
|
|
||||||
;; Returns the number of months between from f and to t. The first
|
;; Returns the number of months between from f and to t. The first
|
||||||
;; month is included in the count, the last month is not.
|
;; month is included in the count, the last month is not.
|
||||||
(define (month-diff f t)
|
(define (month-diff f t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue