[#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:00626] Next misbehavior (sorry :-)
Hi,
I currently try to derive my class `StringIO' from `String', because
to simplyfy thinks a little bit. Now I am struggled over the next
trap...
Please consider following script:
class MyString<String
def initialize(*args)
print "Enter `initialize' with args=`#{args}'\n"
super *args
print "After parent initialization\n"
end
def show
print to_s, "\n"
end
end
mys1 = MyString.new "hello world"
mys1.show
=> hello world
As you can see, the initialize routine will not invoked.
I was struggle over the same trap as I wrote an own example how to build
an own C-coded class for Ruby. I have only provided a new method, and do
all the initialization there. After derivation I have found, that the
initialization function was not invoked.
So quick have a look on `string.c' function `rb_str_s_new'... indeed,
there lacks a call to `rb_obj_call_init'!
Could we get it fixed? And for other classes also? Following script
(based on Gotoken's one):
module Init
def initialize(*args)
print "Enter `initialize'"
end
end
objs = [ Object.new, 0, 0.0, 10**10, 1..10, Class.new, Module.new,
"", {}, [], //, STDOUT, open("/dev/null"),
Struct.new("F").new, Time.now]
args = [nil, [1], [1,2], ["a"], ["a","w+"]]
objs.each do |obj|
klass = obj.type
newklass = Class.new klass
newklass.class_eval %(include Init)
print "\n#{newklass.superclass} ... "
curargs = args.clone
begin
arg = curargs.shift
newobj = newklass.new *arg
rescue
unless curargs.empty?
retry
else
print "#{newklass.superclass} has no `new' method"
end
end
end
print "\n"
shows:
Object ... Enter `initialize'
Fixnum ... Fixnum has no `new' method
Float ... Float has no `new' method
Bignum ... Bignum has no `new' method
Range ...
Class ...
Module ...
String ...
Hash ...
Array ...
Regexp ...
IO ...
File ...
Struct::F ... Enter `initialize'
Time ...
Only `Object' and `Struct' instances seems to call `initialize'.
Furthermore some classes have no `new' method. would it make sense to
add one (for alibi purposes)?
\cle
PS: I go to have a look at the dark sun today here in Germany :-))