Wed May 1 02:22:31 JST 2013

; これはご存知
gosh> '('a)
('a)

でゎ

gosh> '(-i)
(0.0-1.0i)

これだけちょっと引っかかった

Wed May 1 11:16:53 JST 2013

今日以前の最近木曜日の日付を計算する

例えば今日なら => "130425"

(use srfi-19 :only (current-date date-week-day))

(define date
  (let1 a (current-date)
  (let ((m (ref a 'month))
        (d (ref a 'day))
        (y (ref a 'year)))
  (let1 dd (mod (- (date-week-day a) 4) 7)
  (let1 d (- d dd)
  (when (<= d 0)
    (dec! m)
    (set! d (+ d (ref '(0 31 29 31 30 31 30 31 31 30 31 30 31) m)))
    (when (<= m 0)
      (dec! y)))
  (format "~a~2,'0D~2,'0D"
          (substring (number->string y) 2 4) m d))))))