Paste number 35581: clon teaser

Paste number 35581: clon teaser
Pasted by: mega1
1 year, 11 months ago
#lisp
Paste contents:
Raw Source | XML | Display As
;;; SCHEDULE is not mutated by iterating over it by NEXT-TIME. A
;;; SCHEDULER on the other hand is all about remembering the last
;;; time. The schedule here reads as: 'seconds 0, 15, 30 and 45 of
;;; every even minute that's between 10 and 40'.
(let ((schedule (clon:make-cron-schedule
                 :second (clon:make-typed-cron-bumper '(member 0 15 30 45))
                 :minute (clon:make-typed-cron-bumper '(and (integer 10 40)
                                                        (satisfies evenp)
)
)
)
)
)

  (clon:schedule-function (lambda () (write-line "Hello world") (force-output))
                          (clon:make-scheduler schedule)
                          :thread t
)
)


;;; It's in serious need of a terser syntax.

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.