From: pjb@... (Pascal J. Bourguignon) Date: 2009-01-13T15:54:15+09:00 Subject: Re: functional programming Mike Gold writes: > The topic was about the problems arising from the syntactic difference > between methods and lambdas. You've changed gears to a generic > discussion about procs. My question is yet unaddressed: why is > func.call() or func[] or func.() "very useful" compared to func()? As I > mentioned, in every case I've found it to be a hassle, for the reasons > previously stated. The reason is because Ruby is a lisp-2. The same name can be used to designate both a method and a variable. So you need two syntaxes, to make reference to the method of a name, or to the variable. When the variable contains normal values, (def f :function end) f = (lambda { :variable }) irb(main):064:0> [ f , (f []) , (method :f) , (f ()) ] [ f , (f []) , (method :f) , (f ()) ] [#, :variable, #, :function] In Common Lisp, which is a lisp-2 too, we use FUNCALL to call functions stored in variables: (defun f () :function) (defvar f (lambda () :variable)) C/USER[24]> (list f (funcall f) (function f) (f)) (# :VARIABLE # :FUNCTION) -- __Pascal Bourguignon__