From: Yamal Khaled Soueidan Date: 2007-03-28T21:34:42+09:00 Subject: Re: general question (different between methods and functions)? ------=_Part_30126_1194282.1175085279578 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thats what I meant, functions is used without the object, and are called direct, whereas the methods is used with the object. puts "this is a function" File.puts "this is object.method" Is this how everyone see it or do many people have different opinion on this subject? On 3/28/07, James Edward Gray II wrote: > > On Mar 28, 2007, at 3:42 AM, SonOfLilit wrote: > > > Methods are associated with a receiver object. > > > > Functions are not. > > > > The only things you can call functions in Ruby are lambdas, blocks, > > ... Even then it's not clear whether they are methods or functions. > > > > Everything else is methods. > > The above is all true, but we do sometimes refer to calling methods > in a "function-style" in Ruby. That's when you call a method without > an explicit receiver. For example: > > puts "Hello world!" # function-style > file.puts "Hello world!" # normal method call > > Everything is still a method, this is just a name we use for the call > style. > > I only bring it up because it is sometimes referred to in the > documentation for things like private scope and module_function. > > James Edward Gray II > > > ------=_Part_30126_1194282.1175085279578--