ruby-dev summary 21254-21294

Discussion in 'Ruby' started by TAKAHASHI Masayoshi, Sep 6, 2003.

  1. Hello,

    This is a summary of ruby-dev mailing list last week.


    [ruby-dev:21277] multiple assignment

    Koji Arai found a difference of multiple assignment
    between 1.6 and 1.8.

    ex:

    *a = *[]; p a
    def f; yield; end; f {|*a| p a}
    def r; return; end; *a = r(); p a
    => ruby 1.6.8 (2003-08-03) [i586-linux]
    []
    [nil]
    [nil]
    => ruby 1.8.0 (2003-08-28) [i586-linux]
    []
    []
    [nil]

    *a = *[1,2]; p a
    def f; yield *[1,2]; end; f {|*a| p a}
    def r; return *[1,2]; end; *a = r(); p a
    => -:2: warning: `*' interpreted as argument prefix
    ruby 1.6.8 (2003-08-03) [i586-linux]
    [1, 2]
    [1, 2]
    [1, 2]
    => -:2: warning: `*' interpreted as argument prefix
    ruby 1.8.0 (2003-08-28) [i586-linux]
    [1, 2]
    [1, 2]
    [[1, 2]]

    Matz replied that it's not a bug of 1.8, but it shows
    peculiar property of return (and break).

    LHS of multiple assignment and block parameters can find
    whether RHS is (pseudo-)multivalue or not.
    But if RHS is a method, LHS cannot find that.
    When you want to use multiple assignment with return value
    of a method, you should put '*' before the method,
    not after return.


    [ruby-dev:21292] parsedate.rb and time.rb

    Tadayoshi Funaba, the maintainer of parsedate.rb, pointed out
    parsedate.rb doesn't support 'year/month' format but time.rb does.
    He thought parsedate.rb should not support that format.
    Tanaka Akira, the maintainer of time.rb, agreed and fixed
    time.rb.

    Rationale:

    * date formats that parsedate supports should have
    a year, a month and a day.
    * if something is omit, it's a year. parsedate.rb
    supports "Aug 30", "30 Aug", MM/DD and MMDD.
    * slash-splitted format is parsed as 'month/mday/year' or
    'month/mday' (american format).
    * 'foo/bar' should be 'month/mday', not 'year/month'

    Funaba writes more details of parsedate:
    http://www.funaba.org/date2/parsedate.html (in Japanese)


    Regards,

    TAKAHASHI 'Maki' Masayoshi E-mail:
     
    TAKAHASHI Masayoshi, Sep 6, 2003
    #1
    1. Advertising

  2. TAKAHASHI Masayoshi

    Paul Brannan Guest

    On Sat, Sep 06, 2003 at 10:15:54AM +0900, TAKAHASHI Masayoshi wrote:
    > [ruby-dev:21292] parsedate.rb and time.rb
    >
    > Tadayoshi Funaba, the maintainer of parsedate.rb, pointed out
    > parsedate.rb doesn't support 'year/month' format but time.rb does.
    > He thought parsedate.rb should not support that format.
    > Tanaka Akira, the maintainer of time.rb, agreed and fixed
    > time.rb.


    Does this mean time.rb no longer supports year/month?

    Paul
     
    Paul Brannan, Sep 8, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kazuo Saito

    ruby-dev summary 20418 - 20487

    Kazuo Saito, Jul 1, 2003, in forum: Ruby
    Replies:
    0
    Views:
    91
    Kazuo Saito
    Jul 1, 2003
  2. TAKAHASHI Masayoshi

    ruby-dev summary 20489 - 20519

    TAKAHASHI Masayoshi, Jul 9, 2003, in forum: Ruby
    Replies:
    0
    Views:
    96
    TAKAHASHI Masayoshi
    Jul 9, 2003
  3. Kazuo Saito

    ruby-dev summary 20715-20940

    Kazuo Saito, Jul 29, 2003, in forum: Ruby
    Replies:
    0
    Views:
    104
    Kazuo Saito
    Jul 29, 2003
  4. TAKAHASHI Masayoshi

    ruby-dev summary 20941-21133

    TAKAHASHI Masayoshi, Aug 7, 2003, in forum: Ruby
    Replies:
    0
    Views:
    98
    TAKAHASHI Masayoshi
    Aug 7, 2003
  5. Shashank Date

    ruby-dev summary 21134-21191

    Shashank Date, Aug 14, 2003, in forum: Ruby
    Replies:
    2
    Views:
    103
    NAKAMURA, Hiroshi
    Aug 15, 2003
Loading...

Share This Page