* Constant assignment may encompass class and module creation (?)
** Actually a trace rather then a callback
++ set_trace_func is not included, it is a separate "universal" catch-all
Please help clarify which are instance methods (#) and which are class methods
(::). Are there any others, or does that cover the entire gambit?
o = Klass.new("hello\n")
data = Marshal.dump(o)
obj = Marshal.load(data)
obj.sayHello #=> "hello\n"
Dump is being used as module/class method so shouldn't it be 'Marshal::dump' ?
The documentation says they are instance methods, but you can't initialize a
Marshal. What gives?
(Is Marshal singleton, BTW?)
Thanks,
T.
···
On Wednesday 17 November 2004 06:45 am, trans. (T. Onoma) wrote:
Please help clarify which are instance methods (#) and which are class
methods (::).
I've always used :: exclusively for constants, and . for methods.
I much prefer :: over . when referencing method names.
···
On Nov 17, 2004, at 5:51 AM, trans. (T. Onoma) wrote:
On Wednesday 17 November 2004 06:45 am, trans. (T. Onoma) wrote:
> Please help clarify which are instance methods (#) and which are class
> methods (::).
o = Klass.new("hello\n")
data = Marshal.dump(o)
obj = Marshal.load(data)
obj.sayHello #=> "hello\n"
Dump is being used as module/class method so shouldn't it be 'Marshal::dump' ?
The documentation says they are instance methods, but you can't initialize a
Marshal. What gives?
Actually I knew what you meant b/c I agree. But that's something I've noticed
about Ruby, it tries to accommodate a lot of variant styles and tastes, like
{ ... } or do ... end, and the options to use parenthesis with methods or not
--many variations and ways to do the same things.
Nonetheless, I am still at a loss for what appears to me as documentation
errors in ri. I feel like I must be misunderstanding something, but I can't
see what it is.
T.
···
On Wednesday 17 November 2004 03:42 pm, Eric Hodel wrote:
On Nov 17, 2004, at 11:14 AM, Eric Hodel wrote:
> I've always used :: exclusively for constants, and . for methods.
>
> I much prefer :: over . when referencing method names.
Er... I meant . (Class.class_method) over :: (Class::class_method())
Nonetheless, I am still at a loss for what appears to me as documentation errors in ri. I feel like I must be misunderstanding something, but I can't see what it is.
My impression is that there are probably numerous small errors in ri.
I'm sure Dave corrects them as he/we find them. I don't know whether
there's any official reporting mechanism for them.
Thanks Hal. Puts my mind a bit more at ease to know it's not just me and my
craziness.
T.
···
On Wednesday 17 November 2004 06:09 pm, Hal Fulton wrote:
trans. (T. Onoma) wrote:
> Nonetheless, I am still at a loss for what appears to me as documentation
> errors in ri. I feel like I must be misunderstanding something, but I
> can't see what it is.
My impression is that there are probably numerous small errors in ri.
I'm sure Dave corrects them as he/we find them. I don't know whether
there's any official reporting mechanism for them.