Comment detail

n日後を返す関数を返す関数 (Nested Flatten)

This comment is reply for 1269 rubikitch: やっぱposixだけなのかな?(n日後を返す関数を返す関数). Go to thread root.

日付関係ならsrfi-19もあります。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
(use srfi-19)

(define (n-days-later n)
  (lambda (date) (julian-day->date (+ (date->julian-day date) n))))

(let ((now (current-date)))
  (list (date->string (current-date))
        (date->string ((n-days-later 5) (current-date)))))

;; => ("Sat Jul 21 07:07:52-1000 2007" "Thu Jul 26 07:07:52-1000 2007")

Index

Feed

Other

Link

Pathtraq

loading...