Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #35983

Re: When Gregorian replaced Julian

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!gegeweb.org!aioe.org!.POSTED!not-for-mail
From "Rod Pemberton" <buzz@notnotnontnooatno.cmm>
Newsgroups comp.lang.forth
Subject Re: When Gregorian replaced Julian
Date Fri, 23 Jan 2015 20:23:06 -0500
Organization Aioe.org NNTP Server
Lines 43
Message-ID <op.xsx0ssqlv6dtjm@localhost> (permalink)
References <m9s42m$n26$1@dont-email.me>
NNTP-Posting-Host i+Urkql2cL38hhKqzSWEjg.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1; format=flowed; delsp=yes
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Opera Mail/12.16 (Linux)
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.forth:35983

Show key headers only | View raw


On Thu, 22 Jan 2015 19:19:34 -0500, WJ <w_a_x_man@yahoo.com> wrote:

> Using cal, find the month when England adopted the Gregorian
> calendar.
>
> In Emacs Lisp:
>
> (catch 'exit
>   (dolist (year (number-sequence 1750 1799))
>     (princ year)
>     (dolist (month (number-sequence 1 12))
>       (let* ((cal (shell-command-to-string (format "cal %s %s" month  
> year)))
>              (num-days (length (cdr (split-string cal "[^0-9]+" t)))))
>         (princ (format " %s" num-days))
>         (when (< num-days 28)
>           (terpri) (princ cal)
>           (throw 'exit 0))))
>     (terpri)))
>
> Output:
>
> 1750 31 28 31 30 31 30 31 31 30 31 30 31
> 1751 31 28 31 30 31 30 31 31 30 31 30 31
> 1752 31 29 31 30 31 30 31 31 19
>     September 1752
>  S  M Tu  W Th  F  S
>        1  2 14 15 16
> 17 18 19 20 21 22 23
> 24 25 26 27 28 29 30
>
> Show your Forth code.

Which "cal" program are you talking about?  Is this for Linux? ...

You really shouldn't assume that a Gregorian calendar program will
stop returning dates simply because there were no Gregorian dates
prior to a certain date or because some country adopted the calendar
on a certain date.  Most Gregorian calendar programs will continue
to return dates far back in time until they overflow their variables.


Rod Pemberton

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

When Gregorian replaced Julian "WJ" <w_a_x_man@yahoo.com> - 2015-01-23 00:19 +0000
  Re: When Gregorian replaced Julian Mark Wills <markwills1970@gmail.com> - 2015-01-23 01:57 -0800
  Re: When Gregorian replaced Julian "Rod Pemberton" <buzz@notnotnontnooatno.cmm> - 2015-01-23 20:23 -0500
  Re: When Gregorian replaced Julian "WJ" <w_a_x_man@yahoo.com> - 2015-01-24 06:32 +0000

csiph-web