At 07:54 PM 8/9/00 -0600, Nathan Torkington wrote:
>Damian Conway writes:
> > With extra contexts I can be surer:
> >
> > my $yesterday = date() - 86400;     # reasonable to expect epoch integer
> > my $today = "today is " . date();   # reasonable to expect date string
> > my $tomorrow = date()->{DoY} + 1;   # reasonable to expect hash ref
>
>(please hold, thinking out loud)
>
>What is:
>
>   $x = date();
>
>going to return?

It'll make $x a scalar with a completely overloaded set of vtable functions.

>How then does this work?
>
>   somesub( date() );

Date's taken in a list context, as is the default for subs, so it'd spit 
out a list. Possibly it could make an iterator and defer evaluation, but 
that'd depend on some of Damian's stuff getting in. (Which would be rather 
nifty)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to