From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Benjamin Slade Newsgroups: gmane.emacs.help Subject: elisp - common lisp - new calendrical calculations Date: Mon, 13 Jun 2011 11:03:50 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec51967adebcdbf04a59a1186 X-Trace: dough.gmane.org 1307981623 8212 80.91.229.12 (13 Jun 2011 16:13:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2011 16:13:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 13 18:13:37 2011 Return-path: Envelope-to: geh-help-gnu-emacs@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 1QW9le-0000Xm-08 for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jun 2011 18:13:34 +0200 Original-Received: from localhost ([::1]:33514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW9ld-0000kk-AW for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jun 2011 12:13:33 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW9cc-0007Sp-VO for help-gnu-emacs@gnu.org; Mon, 13 Jun 2011 12:04:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW9ca-0003Oh-UO for help-gnu-emacs@gnu.org; Mon, 13 Jun 2011 12:04:14 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:42523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW9ca-0003OU-Fq for help-gnu-emacs@gnu.org; Mon, 13 Jun 2011 12:04:12 -0400 Original-Received: by vws4 with SMTP id 4so4883086vws.0 for ; Mon, 13 Jun 2011 09:04:11 -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=S/K+2GPA9kmBtGe++/ls3nVQFPcz8P/trpEa3G64Zlk=; b=X52fuBJGouLpAoSkR6GC0EF/HkV5KCVUthtK948cyd3XAAqJcadKJg7XfL7rhlTDky HDeAP1rYyWX8I+2z8LwnbSEBCOSozs6BlQR6E0W6/btcOdlZnJRUIMkcqE/6fWvpcLhO 0RmwfhnYYjUVba6Qh9022M50Aj9SV8nbbc3ww= 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=PYaZTWPjuwn1CBaUSqBuIxp8aCsm+eOMwTzUkxRnrcm5UroEBtlfbnLhbtEcKd8reZ TTLEwIs5Di4LfO/N6F4r4vBZP4pOaC6PG9uYkoNmjh/e/uFhNd48Hlxz/wrTeB7ovDvQ OXGDCn2CvrHjmVNhNskfzCp4wFpQCAk+2oP7Y= Original-Received: by 10.52.180.194 with SMTP id dq2mr4536691vdc.105.1307981051055; Mon, 13 Jun 2011 09:04:11 -0700 (PDT) Original-Received: by 10.220.202.129 with HTTP; Mon, 13 Jun 2011 09:03:50 -0700 (PDT) X-Google-Sender-Auth: loXxQM0zNTE6cwGGoyYHsgIFHW8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81341 Archived-At: --bcaec51967adebcdbf04a59a1186 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*. 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) --bcaec51967adebcdbf04a59a1186 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I would like to add a "module" to Emacs for converting from Grego= rian dates into traditional Indian/Hindu dates (Bikrama Samvat), and, perha= ps more importantly, for calculating Hindu holidays.

I found a very = nice set of functions for doing so implemented in Common Lisp in *Deshow, N= achum and Reingold, Edward M. 2008. _Calendrical Calculations_. New York: C= ambridge University Press, 3rd edn*. What is the best way of using this cod= e in Emacs? I know that Emacs Lisp is different from Common Lisp - and I al= so 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 "de= fconst" rather than "defconstant", but even changing that, I= get a "condition-case: 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/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,
= =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.jnanam.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.blogspot.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 o= bscure.' (=C5=9Aatapathabr=C4=81ma=E1=B9=87a 6.1.1.2)

--bcaec51967adebcdbf04a59a1186--