Day of the week: Difference between revisions

(→‎{{header|Elixir}}: add Emacs Lisp)
Line 1,574:
(defun sunday-p (y)
"Is Dec 25th a Sunday in this year?"
(if (= (calendar-day-of-week (list 12 25 y)) 0) yt nil))
 
(defun xmas-sunday (a b)
"In which years in the range a, b is Dec 25th a Sunday?"
(seq-filter (lambda#'sunday-p (x)number-sequence (numberpa xb)))
(mapcar #'sunday-p (number-sequence a b))))
 
(print (xmas-sunday 2008 2121))</lang>
Anonymous user