new calendrical calculations - elisp - common lisp
From:
Benjamin Slade
Subject:
new calendrical calculations - elisp - common lisp
Date:
Mon, 13 Jun 2011 11:40:06 -0500
I
would like to add a "module" to Emacs for converting from Gregorian
dates into traditional Indian/Hindu dates (Bikrama Samvat), and, perhaps
more importantly, for calculating Hindu holidays.
I found a very
nice set of functions for doing so implemented in Common Lisp in
*Deshow, Nachum and Reingold, Edward M. 2008. _Calendrical
Calculations_. New York: Cambridge University Press, 3rd edn*. I was wondering if this perhaps has already been implemented (given that Reingold developed the original calendar calculations for Emacs).
If not: What is
the best way of using this code in Emacs? I know that Emacs Lisp is
different from Common Lisp - and I also know that there is/are
package(s?) for using Common Lisp within Emacs.
What I don't know is: (1) Can this code just be converted into Emacs Lisp? Or are there bits of it which would require Common Lisp?
[Right
now it doesn't work - I know that Emacs Lisp requires "defconst" rather
than "defconstant", but even changing that, I get a "condition-case:
Symbol's value as variable is void: 279457/1080000" error for:
(defconst hindu-sidereal-year ;; TYPE rational ;; Mean length of Hindu sidereal year. (+ 365 279457/1080000))
And changing the definition to (+ 365 (/ 1080000 279457)) it seems just to round.]
(2) Or else, if it is necessary, how to use Common Lisp packages in Emacs.
I'm, obviously, not really a Lisp coder, but I am looking for some pointers for how to get this code working within Emacs.
thanks, --Ben -----------------------------------------------------------------------------------------------------
Benjamin Slade
Dept. of Linguistics
University of Illinois at Urbana-Champaign
[ http://www.jnanam.net/slade/ ]
----------------------------------------------------------------------------------------------------- परो ऽक्ष॑कामा हि देवाः
'The gods love the obscure.' (Śatapathabrāmaṇa 6.1.1.2)