mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-04 03:36:34 +02:00
More testing
This commit is contained in:
parent
68bc9a45c0
commit
ab92070e8c
1 changed files with 12 additions and 20 deletions
|
@ -90,32 +90,23 @@
|
||||||
(($ employee n t) (list t n))))
|
(($ employee n t) (list t n))))
|
||||||
)
|
)
|
||||||
|
|
||||||
(define lst 1)
|
|
||||||
(display
|
|
||||||
(match
|
|
||||||
lst
|
|
||||||
((? string? s) s)
|
|
||||||
(else 0)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(define (calc-time lst)
|
(define (calc-time lst)
|
||||||
(match
|
(match
|
||||||
lst
|
lst
|
||||||
;(() 0)
|
;(() 0)
|
||||||
(((? number? n) (or 's 'seconds 'sec) ) ;. rest)
|
(((? number? n) (or 's 'seconds 'sec) . rest)
|
||||||
(+ 0 (* #e1 n) )) ;(calc-time rest)))
|
(+ 0 (* #e1 n) (calc-time rest)))
|
||||||
;; TODO: interesting compiler error with this line:
|
; ;; TODO: interesting compiler error with these lines:
|
||||||
|
; (((? number? n) (or 's 'seconds 'sec) ) ;. rest)
|
||||||
; (+ (* #e1 n) )) ;(calc-time rest)))
|
; (+ (* #e1 n) )) ;(calc-time rest)))
|
||||||
(((? number? n) (or 'm 'min 'minutes) . rest)
|
(((? number? n) (or 'm 'min 'minutes) . rest)
|
||||||
(+ (* #e60 n) (calc-time rest)))
|
(+ (* #e60 n) (calc-time rest)))
|
||||||
; (((and (? number?) ?n) (or m min minutes) . ?rest)
|
(((? number? n) (or 'hours 'h) . rest)
|
||||||
; (+ (* #e60 n) (calc-time rest)))
|
(+ (* #e60 60 n) (calc-time rest)))
|
||||||
; (((and (? number?) ?n) (or hours h) . ?rest)
|
(((? number? n) (or 'd 'days 'day) . rest)
|
||||||
; (+ (* #e60 60 n) (calc-time rest)))
|
(+ (* #e60 60 24 n) (calc-time rest)))
|
||||||
; (((and (? number?) ?n) (or d days day) . ?rest)
|
(((? number? n) (or 'w 'week 'weeks) . rest)
|
||||||
; (+ (* #e60 60 24 n) (calc-time rest)))
|
(+ (* #e60 60 24 7 n) (calc-time rest)))
|
||||||
; (((and (? number?) ?n) (or w week weeks) . ?rest)
|
|
||||||
; (+ (* #e60 60 24 7 n) (calc-time rest)))
|
|
||||||
(else 0)
|
(else 0)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -123,6 +114,7 @@
|
||||||
(display
|
(display
|
||||||
(list
|
(list
|
||||||
(calc-time '(5 min 10 sec))
|
(calc-time '(5 min 10 sec))
|
||||||
|
(calc-time '(1 day 5 min 10 sec))
|
||||||
))
|
))
|
||||||
|
|
||||||
#;(test-group
|
#;(test-group
|
||||||
|
|
Loading…
Add table
Reference in a new issue