[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

T. Onoma

11/15/2003 11:11:00 AM

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

3 Answers

gabriele renzi

11/15/2003 11:28:00 AM

0

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

>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? )

Joel VanderWerf

11/15/2003 11:51:00 AM

0

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

(http://www.ibiblio.org/zen/gateless-ga...)


Jim Weirich

11/17/2003 7:00:00 PM

0

gabriele renzi wrote:

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

--
-- Jim Weirich jweirich@one.net http://onest...
-----------------------------------------------------------------
"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)