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

Reply via email to