Dave Rolsky schreef:
> On Fri, 3 Oct 2003, Eugene van der Pijll wrote:
> >
> >     $dt1->subtract_datetime( $dt2,
> >                              [ 'months', 'days', 'minutes', 'seconds' ] );
> >
> 
> It's not hard, just a little bit of math.  I'm more concerned with the
> API.  I don't like the one you have up there, but I don't want to just
> change the existing syntax either, maybe something like:
> 
>  $dt1->subtract_datetime( $dt2 ); # current behavior
> 
>  $dt1->subtract_datetime( datetime => $dt2,
>                           units => [ qw( days minutes nanoseconds ) ] );

I didn't really like my API either, but a function with two different
API's isn't very nice either. I can live with both, though, if there is
no better solution.

Eugene

Reply via email to