FAQ
I have released the 0.0503 version of
DateTime::Event::Sunrise. This version closes
the three remaining RT tickets:
https://rt.cpan.org/Ticket/Display.html?id=8065
https://rt.cpan.org/Ticket/Display.html?id=36532
https://rt.cpan.org/Ticket/Display.html?id=77710
The POD documentation has been reorganized,
some unknown bugs may have been fixed :-)
and some other unknown bugs may have been added :-(

There is still a point I am not satisfied with.
Since it involves ergonomy and API, I ask for
your advice.

When trying to compute a sunrise or sunset for
a location beyond the Arctic circle, the module
emits a warning "Sun never rises" or "Sun never
sets". It may bother some programmers, who would
prefer a silent module returning a status code
(just like Paul Schlyter's C code does) and who would
prefer not to tinker with $SIG{__WARN__}.

Several fixes are possible:

1) adding new methods "sun_does_rise" and "sun_does_set".

2) adding new methods "no_sunrise" and "no_sunset".
Problem, there is a negation in the method name,
so users may be confused by a "true" return value:
does it mean that "there is no sunrise" is true,
or does it mean that "there is a sunrise"?

3) add a new method, which returns several values
organized as a hash (or hashref):
{ sunrise_exists => 1,
   sunrise_datetime => ...,
   sunset_exists => 1,
   sunset_datetime => ... }

4) variant of (3), create a new class
DT::E::Sunrise::SingleDay
which applies to:
-- a single location (long+lat)
-- a single date
-- and a single set of technical parameters
(sun altitude, precise algorithm,
upper limb correction).

The "sunrise_exists" and other elements would be
object accessors.

Thank you for your advices,

Jean Forget

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdatetime @
categoriesperl
postedOct 18, '13 at 5:31a
activeOct 18, '13 at 5:31a
posts1
users1
websitemetacpan.org...

1 user in discussion

Jean Forget: 1 post

People

Translate

site design / logo © 2019 Grokbase