[#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
[#357] thinking aloud — "Bryce Dooley" <thecrow@...>
First off, I think Ruby is a very nice scripting language.
7 messages
1999/05/29
[ruby-talk:00333] Re: module-class calling
From:
gotoken@... (GOTO Kentaro)
Date:
1999-05-22 13:27:28 UTC
List:
ruby-talk #333
Hi,
In message "[ruby-talk:00331] module-class calling"
on 99/05/22, "Michael Neumann" <neumann@s-direktnet.de> writes:
>Can I call a function of a module from a class-method?
>Following example didn't work! Why?
Another solution is to let `hello' be a module function by
`module_function':
module A
def hello
print "HELLO\n"
end
module_function :hello
end
class B
def call_A
A.hello
end
end
x = B.new
x.call_A
Module.html#module_function says,
the module functions are the method which is
also the singleton method of a module (or a class).
If a module is included the module functions seems not methods but
just functions. It is because of they are called module *functions*,
I think. In case of calling module functions, preceding module name
(e.g., Math or A) plays like a name space rather than a receiver. It
is very similar to the case of a constant with scope operator `::'
(e.g, Math::PI) -- in deed, class methods or module functions can be
call with :: (e.g., Math::sin(x)) in Ruby 1.3.x.
hope this helps,
-- gotoken