[ruby-talk:00348] Re: Struct.new

From: Clemens Hintze <cle@...>
Date: 1999-05-26 09:28:38 UTC
List: ruby-talk #348
On Wed, 26 May 1999, you wrote:
>Hi.
>
>In message "[ruby-talk:00341] Struct.new"
>    on 99/05/25, "Michael Neumann" <neumann@s-direktnet.de> writes:
>

Hi too,

[...]

>Hmm, it's really easy to relax the member check (with included
>patch).  But I want to discuss whether we should choose this behavior
>or not.  What do you guys (other than Pros) think about this?
>
>                                                matz.

sorry, no other than Pros :-)

I think we should relax it. As I remember a future version of Ruby
could have keyword argument passing (hi, matz :-) so that we could
decide to call it:

s = St.new
s = St.new(3)
s = St.new(3,4)
s = St.new(first:=3)             # Syntax not fixed yet!
s = St.new(second:=4)            # Syntax not fixed yet!
s = St.new(first:=3, second:=4)  # Syntax not fixed yet!

So we would not have to change the behavior in future again, would
we? 

IMHO it should be okay to return nil for members not set. Perhaps a
possibility, to give every member explicite a default value if it is
not set, would be fine.

Just my $0.02

[...]

Clemens.

In This Thread

Prev Next