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)

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!

heh

···

On Sun, Nov 16, 2003 at 03:02:41AM +0900, T. Onoma wrote:

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


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
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

Moin!

Mauricio Fernández wrote:

http://www.rubygarden.org/article.php?sid=294

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!

Regards,
Florian Gross

btw even:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/15434

the last message from matz was

···

il Sun, 16 Nov 2003 06:11:34 +0900, Florian Gross flgr@ccan.de ha scritto::

Moin!

Mauricio Fernández wrote:

http://www.rubygarden.org/article.php?sid=294


Shugo Maeda once proposed making “def” to return symbol name of the
defined method.

Yup: that would work very nicely too.

So, do we have an RCR?

Yes. Would you add it, Mike? Or Dave?
matz.

Florian Gross wrote:

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!

In the RubyConf keynote talk, Matz indicated that Ruby 2.0 would return
/something/ from a def. I don’t recall if he was specific about what
that something was.

···


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