#!/usr/local/bin/clisp ;(setq *args* '("(5 24 5759)")) ;;; calculate yahrzeit. ;;; usage: test.cl "( mo day year )" ;;; Returns the Gregorian date and Parshah ;;; (setq dbg nil) (load 'yc.cl) ;(format t "~%") (defun yahr-dates (y-date h-year) (let* ( (yahr-abs (hebrew-calendar-yahrzeit y-date h-year)) (yahr-greg (calendar-gregorian-from-absolute yahr-abs)) (my-dow (calendar-day-of-week yahr-greg)) (date (calendar-gregorian-from-absolute (- yahr-abs (if (= my-dow 6) 0 (1+ my-dow))) )) ); adjust to previous shb. (declare (special date )) (format t "~A, ~A~%~A~%" (aref calendar-day-name-array my-dow) (calendar-date-string yahr-greg) (diary-parasha)))) ;(trace (yahr-dates :step-if t)) (with-open-file (myargs "/var/tmp/yzargs") (let* ((h-today (calendar-hebrew-from-absolute (calendar-absolute-from-gregorian date))) (h-year (third h-today)) (my-date (read-from-string (read-line myargs))) (yymm00 (list (car my-date) (car (cdr my-date)) 5760)) (today0 (list (car h-today) (car (cdr h-today)) 5760))) (if (and (equal (car my-date) 7) (> (calendar-absolute-from-hebrew today0) (calendar-absolute-from-hebrew yymm00))) (setq h-year (1+ h-year))) (yahr-dates my-date h-year) (if (and (hebrew-calendar-leap-year-p h-year) (equal (car my-date) 12)) (progn (setf (car my-date) (1+ (car my-date))) (yahr-dates my-date h-year)))) (if dbg (progn (print date) (print today0) (print yymm00) (print my-date) (print h-year))) ) ;(list-yahrzeit-dates (list 10 17 1974) 2000) (5 24 5759)