Def

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

T. Onoma wrote:

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.’

(It is Not Mind, It is Not Buddha, It is Not Things)

what is this def?

A keyword

it is not a method…?

No.

it is not some sugar…?

Sort of. (But you could say that pretty much everything in modern
languages is sugar).

well might it be a lambda…?

No.

just what is this def?

···

On Sat, 15 Nov 2003, T. Onoma wrote:

See above.

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

Not really.

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() :slight_smile:

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

I would have loved init :frowning:

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

···

il Sat, 15 Nov 2003 20:11:13 +0900, “T. Onoma” transami@runbox.com ha scritto::

Hi!

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

On Sat, 15 Nov 2003, T. Onoma wrote:

it is not a method…?

No.

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

                    .-------.

message > 100 kB? / | |
sender = spammer? / | R.I.P.|
text = spam? / | |

gabriele renzi wrote:

I would have loved init :frowning:

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.

···


– Jim Weirich jweirich@one.net http://onestepback.org

“Beware of bugs in the above code; I have only proved it correct,
not tried it.” – Donald Knuth (in a memo to Peter van Emde Boas)