[#539] A new discussion topic ;-) — Clemens Hintze <c.hintze@...>
Hi all,
[#546] Question concerning modules (1) — clemens.hintze@...
[#548] Bug: concerning Modules! — clemens.hintze@...
[#564] Ruby 1.3.7 — Yukihiro Matsumoto <matz@...>
Ruby 1.3.7 is out, check out:
[#567] New feature request! :-) — clemens.hintze@...
On 6 Aug, Yukihiro Matsumoto wrote:
Hi,
On 6 Aug, Yukihiro Matsumoto wrote:
[#590] Bug in Array#clone! — clemens.hintze@...
Hi,
Hi,
[#600] A `File' is not a `IO'????? — clemens.hintze@...
Hi,
On 10 Aug, Yukihiro Matsumoto wrote:
Hi,
Hi,
Hi,
On 11 Aug, GOTO Kentaro wrote:
Hi,
On 11 Aug, Yukihiro Matsumoto wrote:
Hi,
[#607] How to pass by `new' method of superclass? — clemens.hintze@...
[#626] Next misbehavior (sorry :-) — clemens.hintze@...
Hi,
[#634] ANN: testsupp.rb 0.1 — Clemens Hintze <c.hintze@...>
Hi,
[#637] Backtrace of SIGSEGV — Clemens Hintze <c.hintze@...>
Hi,
Hi,
On 12 Aug, Yukihiro Matsumoto wrote:
Hi,
On 12 Aug, Yukihiro Matsumoto wrote:
Hi,
[#655] Your wish is fulfilled (erhm, almost ;-) — Clemens Hintze <c.hintze@...>
Hi Gotoken,
[#667] How do I use `callcc' — Clemens Hintze <c.hintze@...>
Hi,
[#668] Way to intercept method calls? — Clemens Hintze <c.hintze@...>
Hi,
[#679] Documentation about RD? — Clemens Hintze <c.hintze@...>
Hi,
=begin
On 18 Aug, Toshiro Kuwabara wrote:
Hi,
On 18 Aug, GOTO Kentaro wrote:
Hi,
On 19 Aug, Toshiro Kuwabara wrote:
Hi,
On 19 Aug, Toshiro Kuwabara wrote:
Hi,
Hi,
On 19 Aug, Toshiro Kuwabara wrote:
Hi
Hi,
Hi,
Hi Tosh and all,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
On 19 Aug, Yukihiro Matsumoto wrote:
Hi,
On 20 Aug, Toshiro Kuwabara wrote:
Hi,
On 21 Aug, Toshiro Kuwabara wrote:
Hi,
On 21 Aug, Toshiro Kuwabara wrote:
Hi,
Hi,
Hi,
On 24 Aug, Toshiro Kuwabara wrote:
Hi,
I thought people might be interested in this. Here's how I am plugging
On 31 Aug, Jonathan Aseltine wrote:
[#737] RD with multi charset — Minero Aoki <aamine@...>
Hi, I'm Minero Aoki. This is my first mail in this mailling list.
Hi,
Hi,
Hi,
Hi,
On 28 Aug, Minero Aoki wrote:
Hi,
[ruby-talk:00594] Re: Bug in Array#clone!
In message "[ruby-talk:00590] Bug in Array#clone!"
on 99/08/09, clemens.hintze@alcatel.de <clemens.hintze@alcatel.de> writes:
|and here the next problem... :-)
Well, thank .. you.
|A short analyze of array.c let me believe, that `Array#clone' is wrong.
|It seems only to clone the own (hidden) memory, but forget all about
|possible instance variables.
You are right. I modified CLONESETUP() to copy instance variables.
|As I have seen, the datatype `RArray' has no `iv_table' pointer. But as
|the example shows, instance variables could be stored too. But how?
It is done by one big hash table of hashes. See variable.c around
*_generic_ivar() functions.
--- /tmp/ruby.h Tue Aug 10 00:21:16 1999
+++ ruby.h Mon Aug 9 23:52:35 1999
@@ -211,6 +211,7 @@
}
-#define CLONESETUP(clone,obj) {\
+#define CLONESETUP(clone,obj) do {\
OBJSETUP(clone,rb_singleton_class_clone(RBASIC(obj)->klass),RBASIC(obj)->flags);\
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);\
-}
+ if (FL_TEST(obj, FL_EXIVAR)) rb_clone_generic_ivar(clone,obj);\
+} while (0)
--- /tmp/variable.c Tue Aug 10 00:21:27 1999
+++ variable.c Tue Aug 10 00:03:34 1999
@@ -788,2 +788,3 @@
+ if (!generic_iv_tbl) return;
if (st_lookup(generic_iv_tbl, obj, &tbl)) {
@@ -807,4 +808,4 @@
{
- if (special_generic_ivar == 0) return;
if (!generic_iv_tbl) return;
+ if (special_generic_ivar == 0) return;
st_foreach(generic_iv_tbl, givar_i, 0);
@@ -820,2 +821,14 @@
st_free_table(tbl);
+}
+
+void
+rb_clone_generic_ivar(clone, obj)
+ VALUE clone, obj;
+{
+ st_table *tbl;
+
+ if (!generic_iv_tbl) return;
+ if (st_lookup(generic_iv_tbl, obj, &tbl)) {
+ st_add_direct(generic_iv_tbl, clone, st_copy(tbl));
+ }
}