all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Benjamin Slade <slade@jnanam.net>
To: help-gnu-emacs@gnu.org
Subject: elisp - common lisp - new calendrical calculations
Date: Mon, 13 Jun 2011 11:03:50 -0500	[thread overview]
Message-ID: <BANLkTikbqvWXZg96PEBfY3+9SqKzNAbkrg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]

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*. 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 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æfcræft & Vyākaraṇa (lingblog) - http://staefcraeft.blogspot.com
The Babbage Files (techblog) - http://babbagefiles.blogspot.com

-----------------------------------------------------------------------------------------------------
  परो ऽक्ष॑कामा हि देवाः
    'The gods love the obscure.' (Śatapathabrāmaṇa 6.1.1.2)

[-- Attachment #2: Type: text/html, Size: 2531 bytes --]

             reply	other threads:[~2011-06-13 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13 16:03 Benjamin Slade [this message]
2011-06-13 16:19 ` elisp - common lisp - new calendrical calculations Drew Adams
2011-06-13 16:35   ` Benjamin Slade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTikbqvWXZg96PEBfY3+9SqKzNAbkrg@mail.gmail.com \
    --to=slade@jnanam.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.