From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Edward Reingold Newsgroups: gmane.emacs.devel Subject: Re: new calendrical calculations - elisp - common lisp Date: Mon, 13 Jun 2011 12:06:19 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1307985472 32263 80.91.229.12 (13 Jun 2011 17:17:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2011 17:17:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Benjamin Slade Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 13 19:17:48 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 1QWAln-0000fu-8G for ged-emacs-devel@m.gmane.org; Mon, 13 Jun 2011 19:17:47 +0200 Original-Received: from localhost ([::1]:50322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWAlm-0002Qj-Hh for ged-emacs-devel@m.gmane.org; Mon, 13 Jun 2011 13:17:46 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWAdb-0000fq-Qd for emacs-devel@gnu.org; Mon, 13 Jun 2011 13:09:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWAdZ-0006zs-Ua for emacs-devel@gnu.org; Mon, 13 Jun 2011 13:09:19 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:46889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWAdZ-0006zl-Lm for emacs-devel@gnu.org; Mon, 13 Jun 2011 13:09:17 -0400 Original-Received: by wyf19 with SMTP id 19so4142066wyf.0 for ; Mon, 13 Jun 2011 10:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=+gM+kE9iiDp9dcWO4AmT9/EkIp3ggwJU7mrUqDIUano=; b=uzmueaJFvN8lvnkvSp286gXeJMUNPh/3HZ4ohcFvjvvUMH9xlwVfznPsipYaaQL/x+ B8Vt0gMdlRVnZJXvu6XsaEe7ZZ431yypvhTryUN36WNZl6q/DWe/TgJ51fzk+dHf9Yj3 O84FbpFNN7ZYRoVj0SH2t97Z20Tp5JTgC15Rg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=I8cliiZZDhr67mc90xNEGTcof48vKZReTJSXeLHPKxy77LaDb8B1Xfnh3vK6odPuY7 jJq317LZM+L4W8y473qna/Bc2JrYxLUETg54+/K8BRDWQywveDVtQ4b93aQlKCrLTZVY ddMvD5J8vkUuFFGIaCPjThchOUNDFYMWLlnAE= Original-Received: by 10.216.237.131 with SMTP id y3mr2963712weq.87.1307984956348; Mon, 13 Jun 2011 10:09:16 -0700 (PDT) Original-Received: by 10.216.86.197 with HTTP; Mon, 13 Jun 2011 10:06:19 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: svAK67N_ZPft09ZqenNfuSwaW5Y X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 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:140422 Archived-At: Sorry, the code in our book is NOT in the public domain and cannot be used in Emacs. On Mon, Jun 13, 2011 at 11:40 AM, Benjamin Slade wrote: > I would like to add a "module" to Emacs for converting from Gregorian dat= es > 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 L= isp > in *Deshow, Nachum and Reingold, Edward M. 2008. _Calendrical Calculation= s_. > 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 Ema= cs > 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-cas= e: > 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 t= o > 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 i= n > it yet]. > > I'm, obviously, not really a Lisp coder, but I am looking for some pointe= rs > for how to get this code working within Emacs. > > thanks, > =C2=A0 --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://staefcra= eft.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 obscure.' (=C5=9Aatapathabr=C4=81ma=E1= =B9=87a 6.1.1.2) >