On 26/3/03 9:44 am, Eugene van der Pijll at [EMAIL PROTECTED] spake thus:

> Rick Measham schreef:
>>> Best solution would perhaps to convert to Julian at the start of those
>>> methods, and to convert them back to Gregorian at the end.
>>> (DateTime::Calendar::Julian could be useful here ;-)
>> 
>> Yeah, I figured I might have to do that, although then rather than finding
>> the Easter in Julian Year 35000, I need to find it between Julian
>> Equivalents of Gregorian Jan  1 35000 and Gregorian Dec 31 35000. Which just
>> isn't so easy as calling it with a year. I'll need to call the potential
>> (three?) years that overlap the single Gregorian year, and then find the
>> Easter that intersects with the Gregorian year.
>> 
>> Hmmm .. I see some use for DateTime::Set::intersect there...
> 
> Only if you have (public) functions that are called with a year. If not,
> you can convert to Julian at the start of following(); call easter()
> with the Julian year; convert back to Gregorian. The Orthodox Easter is
> always in the second quarter of the Julian year (though not always in
> Spring), and there's always only one per year.

I'll give that a go, see what happens

> If eastern_easter is a public function (it is not documented), I suggest
> a small piece of POD:

It's not public, unlike western_easter (which can be exported as 'easter',
although I've never tested this!)

> 
>> Speaking of which: Is there any better way to conditionally load a module
>> other than:
>> eval("use DateTime::Set");
>> croak("Couldn't load DateTime::Set:".$@) if $@;
> 
> Block-eval is better than string-eval. Also I think 'require' is used
> more often than 'use' in these kind of constructs, but I don't think
> there's a material difference.

Can't use a block eval for 'use X'. All 'use X' commands are parsed before
anything else, so it will always try to use X, even if we don't go there.

'require X' happens at run-time so doesn't need to be eval-ed. BUT, does
'require' do all that I need it to do? I know it doesn't import for one.

>>> And some small points:
> 
> Before I forget: the file had MS-DOS line endings, and no EOL on the
> last line. this confused my vi.

ROFL! I'm creating this on a mac with unix line endings. Maybe my mail
program changed it! Hmm .. maybe I should send it some other way.

Cheers!
Rick

--------------------------------------------------------
�� � � � � � There are 10 kinds of people:
�� those that understand binary, and those that don't.
--------------------------------------------------------
�� The day Microsoft makes something that doesn't suck
�� � is the day they start selling vacuum cleaners
--------------------------------------------------------


Reply via email to