Nathan Wiger wrote:
> 
> > C is, at times, less than logical. Witness the localtime fun: some of it's
> > zero-based, some of it's one-based, and some of it's -1900-based. All from the
> > same function. The localtime concept is needed, the localtime brain damage is
> > really not.
> 
> I agree completely. I take issue with changing localtime(), though,
> because
> 
>    1. *Many* Perl scripts already use it
>    2. *Many* C programmers are familiar with its stupidity
> 
> If we want to "fix" it, why not offer up something like this?
> 
>    1. Deprecate the current localtime() with a warning
>    2. Make a new, better date() function that returns
>       the "correct" args in what we feel to be the "correct"
>       format
> 
> This has two key advantages:
> 
>    1. Existing programs don't break
>    2. Existing programmers won't say "Oh, localtime()! I
>       know how that works!"
> 
> An existing Perl 5 script:
> 
>    my $date = localtime();
> 
> Could generate something like
> 
>    "Function localtime() deprecated - use date() instead"
> 
> And then we could make date() return the year + 1900, months starting
> with 1, etc, etc.
> 
> -Nate

  Good ideas.  While we're on the subject, features of Perl5 that go
away in Perl6 should probably be deprecated in perl 5.[78].

  Creating an all new function is a very good idea, I think.  The
whole function "localtime" should just plain go away.

  Re: key advantage #1, keep in mind that Perl6 will include a
translator that will convert Perl5 programs to Perl6 programs.  We
don't have to worry about breaking anything, as long as we can come up
with a scheme that can be automatically translated most of the time.

Reply via email to