[#300] Ruby 1.3.3-990507 — matz <matz@...>
Ruby 1.3.3-990507 is out, check out:
1 message
1999/05/07
[#314] Arity features for Proc object? — matz@... (Yukihiro Matsumoto)
A mail from <yeboah@tu-harburg.de> is somehow rejected by the list
12 messages
1999/05/17
[#315] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
[#316] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00315] Re: Arity features for Proc object?"
[#318] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#319] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00318] Re: Arity features for Proc object?"
[#320] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#323] binding — Pros Yeboah <yeboah@...>
Hi
5 messages
1999/05/18
[#331] module-class calling — "Michael Neumann" <neumann@...>
Hi...
5 messages
1999/05/22
[#357] thinking aloud — "Bryce Dooley" <thecrow@...>
First off, I think Ruby is a very nice scripting language.
7 messages
1999/05/29
[ruby-talk:00343] Re: Struct.new
From:
matz@... (Yukihiro Matsumoto)
Date:
1999-05-26 02:58:46 UTC
List:
ruby-talk #343
Hi.
In message "[ruby-talk:00341] Struct.new"
on 99/05/25, "Michael Neumann" <neumann@s-direktnet.de> writes:
|Following code is incompatible between 1.25 and 1.3x
|
|#version 1.25:
|St = Struct.new("St", :first, :second)
|s = St.new
|
|#version 1.3x:
|St = Struct.new("St", :first, :second)
|s = St.new # error: `initialize': struct size differs (ArgumentError)
|a = St.new(3,4) #works
|
|Perhaps this could be changed?
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.
--- struct.c 1999/05/25 08:26:17 1.1.1.3.2.6
+++ struct.c 1999/05/26 02:35:22
@@ -251,8 +251,12 @@
size = iv_get(klass, "__size__");
n = FIX2INT(size);
- if (n != RARRAY(values)->len) {
+ if (n < RARRAY(values)->len) {
rb_raise(rb_eArgError, "struct size differs");
}
MEMCPY(RSTRUCT(self)->ptr, RARRAY(values)->ptr, VALUE, RARRAY(values)->len);
+ if (n > RARRAY(values)->len) {
+ rb_mem_clear(RSTRUCT(self)->ptr+RARRAY(values)->len,
+ n-RARRAY(values)->len);
+ }
return Qnil;
}