Ask a Question related to Ruby, Design and Development.
-
T. Onoma #1
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 Guest
-
gabriele renzi #2
Re: def
il Sat, 15 Nov 2003 20:11:13 +0900, "T. Onoma" <transami@runbox.com>
ha scritto::
a keyword?>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?
well, btw it is also sugar fore define_method() :)
I would have loved init :(>(funny we say def for define but not init for initialize)
sidenote: what about that old thread about making def return something
useful ? (I remember that an UnboundMethod was refused, but what about
a Symbol? )
gabriele renzi Guest
-
Joel VanderWerf #3
Re: def
T. Onoma wrote:
It is a special form. Or, to paraphrase the Gateless Gate,> 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
>
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.'
([url]http://www.ibiblio.org/zen/gateless-gate/27.html[/url])
Joel VanderWerf Guest
-
Chad Fowler #4
Re: def
On Sat, 15 Nov 2003, T. Onoma wrote:
# 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?
#
See above.
# (funny we say def for define but not init for initialize)
#
Not really.
Chad Fowler Guest
-
T. Onoma #5
Re: def
i ask b/c i was thinking it would be good if def actually returned a value, i.e. the symbol of the method being defined.
def foo # => :foo
...
end
why?
private def foo
...
end
instead of having to do seperated way.
-t0
> 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)
T. Onoma Guest
-
Rich #6
Chromeless Windows EXE
I can already open my EXE from Ruby using:
IO.popen("gui.exe")
I'm hoping that I can remove the chrome from that EXE before I run it...
... either at runtime with some command or option...
... or before I run it if there's some place in the binary file I can change
something...
... it might even be ok if I had to embed the exe in some other exe... as
long as I could still give everything to the client in 'one exe'...
... is there a simple way?
Thanks!
-Rich
P.s. - I'm really, really clueless about any serious programming, so please
go easy on me if it's simple... thanks!
Rich Guest
-
Mauricio Fernández #7
Re: def
On Sun, Nov 16, 2003 at 03:02:41AM +0900, T. Onoma wrote:
heh> i ask b/c i was thinking it would be good if def actually returned a value, i.e. the symbol of the method being defined.
>
> def foo # => :foo
> ...
> end
>
> why?
>
> private def foo
> ...
> end
[url]http://www.rubygarden.org/article.php?sid=294[/url]
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
Not only Guinness - Linux is good for you, too.
-- Banzai on IRC
Mauricio Fernández Guest
-
Florian Gross #8
Re: def
Moin!
Mauricio Fernández wrote:
I did some more thinking on my initial suggestion and came to the> [url]http://www.rubygarden.org/article.php?sid=294[/url]
conclusion that def should return a Method which like all other Methods
should have a #to_sym.
It sure would be nice to know what matz thinks about all of this!
Regards,
Florian Gross
Florian Gross Guest
-
gabriele renzi #9
Re: def
il Sun, 16 Nov 2003 06:11:34 +0900, Florian Gross <flgr@ccan.de> ha
scritto::
btw even:>Moin!
>
>Mauricio Fernández wrote:
>>>> [url]http://www.rubygarden.org/article.php?sid=294[/url]
[url]http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/15434[/url]
the last message from matz was
------->> Shugo Maeda once proposed making "def" to return symbol name of the
>> defined method.Yes. Would you add it, Mike? Or Dave?>Yup: that would work very nicely too.
>
>So, do we have an RCR?
matz.
gabriele renzi Guest
-
Josef 'Jupp' SCHUGT #10
Re: def
Hi!
* Chad Fowler; 2003-11-15, 21:03 UTC:Just for clarification: That is "no" as in "No, it really isn't", not> On Sat, 15 Nov 2003, T. Onoma wrote:
> # it is not a method...?
>
> No.
"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? / ___| |___
Josef 'Jupp' SCHUGT Guest
-
Jim Weirich #11
Re: def
Florian Gross wrote:
In the RubyConf keynote talk, Matz indicated that Ruby 2.0 would return> I did some more thinking on my initial suggestion and came to the
> conclusion that def should return a Method which like all other Methods
> should have a #to_sym.
>
> It sure would be nice to know what matz thinks about all of this!
/something/ from a def. I don't recall if he was specific about what
that something was.
--
-- Jim Weirich [email]jweirich@one.net[/email] [url]http://onestepback.org[/url]
-----------------------------------------------------------------
"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)
Jim Weirich Guest
-
Jim Weirich #12
Re: def
gabriele renzi wrote:
I'm thinking that Ruby should accept any method that is a one-character> I would have loved init :(
>
misspelling of initialize as an initializer. Perhaps I'll write an RCR.
--
-- Jim Weirich [email]jweirich@one.net[/email] [url]http://onestepback.org[/url]
-----------------------------------------------------------------
"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)
Jim Weirich Guest



Reply With Quote

