[#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:00546] Question concerning modules (1)
Hi,
I want to show you a small log excerpt. I would like to ask, whether
you can help me to understand?
$ ruby -v
ruby 1.3.6 (1999-07-28) [sparc-solaris2.6]
$ rbc
rbc0> module Foo
rbc1> @ivar = 12
rbc1>
rbc1> def show
rbc2> print "Value is: `#{@ivar}'\n"
rbc2> end
rbc1> end
nil
# Okay! Here I have defined a module `Foo With an instance variable???
rbc0> Foo.show
NameError: (eval):1: undefined method `show' for Foo:Module
# That means, `Foo' does not know the method `show'. I guess, because
# it is not a module function, right?
rbc0> foo = Foo.clone
Foo
# Now I have cloned `Foo' and store it into a variable
rbc0> foo.show
NameError: (eval):1: undefined method `show' for Foo:Module
# Hmm, the instance in `foo' doesn't know `show' yet. Is okay, I guess.
# Same reason as before.
rbc0> Foo.instance_variables.include? "@ivar"
true
# Aha! `Foo' contains the instance variable.
rbc0> foo.instance_variables.include? "@ivar"
true
# And so does `foo'!
rbc0> Foo.methods.include? :show
false
# Oops! `Foo' knows about instance variables, but not methods????
rbc0> foo.methods.include? :show
false
# Same here...
rbc0> foo.extend(Foo)
Foo
# Now the instance referred by `foo' will be extend by module `Foo'. I
# would not assume something special here! As `foo' is already a `Foo',
# it should not change anything, should it?
rbc0> foo.methods.include? :show
false
# Right! It has changed nothing. Or ... ?
rbc0> foo.show
Value is: `12'
nil
# Hah! Gotcha! What is that? Please help and explain!
rbc0> ^D
NOTE PLEASE: I donエt want to change anything here. I will that current
behavior, to implement a tricky module. I will post it
later to the list. I only want to understand, what is going
on here! :-)
\cle