匿名 #244(2007/07/06 10:24 GMT) [ Scheme ] Rating1/1=1.00
Scheme(Gauche)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
(use srfi-1) (use srfi-19) (define (week-days year month day) (let* ((now (make-date 0 0 0 0 day month year (date-zone-offset (current-date)))) (start (- (date->modified-julian-day now) (date-week-day now) -1))) (map (lambda (x) (let* ((date (modified-julian-day->date (+ start x))) (dow (list-ref '("日""月""火""水""木""金""土") (date-week-day date))) (fmt (date->string (modified-julian-day->date (+ start x)) #`"~1(,dow)"))) fmt)) (iota 5)))) ;; 出力例 gosh> (for-each print (week-days 2007 7 6)) 2007-07-02(月) 2007-07-03(火) 2007-07-04(水) 2007-07-05(木) 2007-07-06(金) gosh> (for-each print (week-days 2007 7 31)) 2007-07-30(月) 2007-07-31(火) 2007-08-01(水) 2007-08-02(木) 2007-08-03(金) gosh> (for-each print (week-days 2007 12 31)) 2007-12-31(月) 2008-01-01(火) 2008-01-02(水) 2008-01-03(木) 2008-01-04(金)
Rating1/1=1.00-0+
[ reply ]
匿名
#244()
[
Scheme
]
Rating1/1=1.00
Rating1/1=1.00-0+
[ reply ]