def

T

T. Onoma

what is this def?
it is not a method...?
it is not some sugar...?
well might it be a lambda...?
just what is this def?

(funny we say def for define but not init for initialize)

-t0
 
G

gabriele renzi

what is this def?
it is not a method...?
it is not some sugar...?
well might it be a lambda...?
just what is this def?

a keyword?
well, btw it is also sugar fore define_method() :)
(funny we say def for define but not init for initialize)

I would have loved init :(

sidenote: what about that old thread about making def return something
useful ? (I remember that an UnboundMethod was refused, but what about
a Symbol? )
 
J

Joel VanderWerf

T. Onoma said:
what is this def?
it is not a method...?
it is not some sugar...?
well might it be a lambda...?
just what is this def?

(funny we say def for define but not init for initialize)

-t0

It is a special form. Or, to paraphrase the Gateless Gate,

A monk asked Nansen: `Is there a teaching no master ever preached before?'

Nansen said: `Yes, there is.'

`What is it?' asked the monk.

Nansen replied: `It is not a method, it is not some sugar, it is not
lambda.'

(http://www.ibiblio.org/zen/gateless-gate/27.html)
 
J

Josef 'Jupp' SCHUGT

Hi!

* Chad Fowler; 2003-11-15, 21:03 UTC:

Just for clarification: That is "no" as in "No, it really isn't", not
"no" as in "No, that is wrong" (which it to my knowledge would mean
in Japanese).

Josef 'Jupp' Schugt
 
J

Jim Weirich

gabriele said:
I would have loved init :(

I'm thinking that Ruby should accept any method that is a one-character
misspelling of initialize as an initializer. Perhaps I'll write an RCR.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,807
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top