From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Benjamin Slade Newsgroups: gmane.emacs.devel Subject: new calendrical calculations - elisp - common lisp Date: Mon, 13 Jun 2011 11:40:06 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec54fb0c69004bb04a59a9303 X-Trace: dough.gmane.org 1307983572 20492 80.91.229.12 (13 Jun 2011 16:46:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2011 16:46:12 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 13 18:46:08 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QWAH9-0000iR-Qy for ged-emacs-devel@m.gmane.org; Mon, 13 Jun 2011 18:46:08 +0200 Original-Received: from localhost ([::1]:54020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWAH9-0005ey-0P for ged-emacs-devel@m.gmane.org; Mon, 13 Jun 2011 12:46:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWABk-00050S-2U for emacs-devel@gnu.org; Mon, 13 Jun 2011 12:40:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWABh-0001zk-F8 for emacs-devel@gnu.org; Mon, 13 Jun 2011 12:40:31 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:37652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWABg-0001zX-NP for emacs-devel@gnu.org; Mon, 13 Jun 2011 12:40:29 -0400 Original-Received: by vws4 with SMTP id 4so4922946vws.0 for ; Mon, 13 Jun 2011 09:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=hFJwhjR13Kz/Org5yZs+uu2iz3TKK9rZHVKmhpzh2nU=; b=LPCSRnKlqx3s/EVYturlT1iU+m9nF7e5DYUEsi/QcZyBX4IbR+jBessDs6tYhdfcA4 VhNJ2L9OzmgrE2ABgdYcz9nNHzJptR83+hUSExOpHvO372jBBopE9hU3qbgBLKQk0Tkc nwgmBtGAenfYU7+f3OKuElX0qfKXy5TVKzJQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=c/VFoYuAGEJFuK3WB5FP4zVHzIugm7mZDDrrqgjPoUzDNeNVgG2InfYypp9SKaCsti qI1btmLcuID3PRkLp2joi50g/VteF5L3hTgoOFib041tnquRdWkyT71PKY2dwlFGuUBj 204IPvTX2ETURJjQJEGcxbA/TgLtQ1msatsbY= Original-Received: by 10.220.215.138 with SMTP id he10mr1955814vcb.216.1307983226078; Mon, 13 Jun 2011 09:40:26 -0700 (PDT) Original-Received: by 10.220.202.129 with HTTP; Mon, 13 Jun 2011 09:40:06 -0700 (PDT) X-Google-Sender-Auth: YK0lcDQKGpHjxG9wlWUIqtcGNA4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.41 X-Mailman-Approved-At: Mon, 13 Jun 2011 12:45:48 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:140417 Archived-At: --bcaec54fb0c69004bb04a59a9303 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Lis= p 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 i= t 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 have transcribed the code here: http://www.jnanam.net/emacs/hindu-calendar.el [there are probably typos in it yet]. 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/ ] St=C3=A6fcr=C3=A6ft & Vy=C4=81kara=E1=B9=87a (lingblog) - http://staefcraef= t.blogspot.com The Babbage Files (techblog) - http://babbagefiles.blogspot.com ---------------------------------------------------------------------------= -------------------------- *=E0=A4=AA*=E0=A4=B0=E0=A5=8B =E0=A4=BD=E0=A4=95=E0=A5=8D=E0=A4=B7=E0=A5= =91=E0=A4=95=E0=A4=BE*=E0=A4=AE=E0=A4=BE* =E0=A4=B9=E0=A4=BF *=E0=A4=A6=E0= =A5=87*=E0=A4=B5=E0=A4=BE=E0=A4=83 'The gods love the obscure.' (=C5=9Aatapathabr=C4=81ma=E1=B9=87a 6.1.1.= 2) --bcaec54fb0c69004bb04a59a9303 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I would like to add a "module" to Emacs for converting from Gregor= ian=20 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=20 *Deshow, Nachum and Reingold, Edward M. 2008. _Calendrical=20 Calculations_. New York: Cambridge University Press, 3rd edn*. I was wonder= ing if this perhaps has already been implemented (given that Reingold devel= oped the original calendar calculations for Emacs).

If not: What is= =20 the best way of using this code in Emacs? I know that Emacs Lisp is=20 different from Common Lisp - and I also know that there is/are=20 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&q= uot; rather than "defconstant", but even changing that, I get a "condit= ion-case:=20 Symbol's value as variable is void: 279457/1080000" error for:

=C2=A0(defconst hindu-sidereal-year
=C2=A0 ;; TYPE rational
=C2= =A0 ;; Mean length of Hindu sidereal year.
=C2=A0 (+ 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 Ema= cs.

I have transcribed the code here: http://www.jnanam.net/emacs/h= indu-calendar.el [there are probably typos in it yet].

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,
= =C2=A0 --Ben
-----------------------------------------------------------= ------------------------------------------
Benjamin Slade
Dept. of Linguistics
University of Illinois at Urbana-Champaign=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
[ http://www.jna= nam.net/slade/ ]=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
=C2=A0=C2=A0
St=C3=A6fcr=C3=A6ft & Vy=C4=81kara=E1=B9=87a (lingblog) - http://staefcraeft.blogsp= ot.com
The Babbage Files (techblog) - http://babbagefiles.blogspot.com

---------------------------------------------------------------------------= --------------------------
=C2=A0 =E0=A4=AA=E0=A4=B0=E0=A5=8B =E0=A4=BD=E0=A4=95=E0=A5=8D=E0=A4= =B7=E0=A5=91=E0=A4=95=E0=A4=BE=E0=A4=AE=E0=A4=BE =E0=A4=B9=E0=A4=BF = =E0=A4=A6=E0=A5=87=E0=A4=B5=E0=A4=BE=E0=A4=83
=C2=A0 =C2=A0 'The gods love the obscure.' (=C5=9Aatapathabr=C4=81m= a=E1=B9=87a 6.1.1.2)
--bcaec54fb0c69004bb04a59a9303--