Chaim Frenkel wrote:

Strange thought just crossed my mind.

Would having a time object that is understood by perl be sufficient?
It would smell and taste like an integer but would otherwise be
magical.
This is something that should be easily doable if RFC 73, "All Perl core
functions should return objects", gets adopted. Then we could easily
have time() return an object which, when in a numeric or string context,
evaluates to the UNIX epoch seconds. But it could easily have object
methods like:

$t = time; # Generate time object
print $t; # UNIX epoch
$t++; # UNIX epoch + 1

$t->mjdate; # Modified Julian Date
$t->systime; # System time
$t->unix; # UNIX epoch, same as NUMBER and STRING
$t->judaic; # You get the idea... :-)

Embedded objects are looking better all the time...

-Nate

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-language-datetime @
categoriesperl
postedSep 4, '00 at 7:18p
activeSep 4, '00 at 7:18p
posts1
users1
websiteperl6.org

1 user in discussion

Nathan Wiger: 1 post

People

Translate

site design / logo © 2021 Grokbase