From: Edward Faulkner Date: 2005-10-20T04:51:19+09:00 Subject: Re: Functional with Ruby --CUfgB8w4ZwR/yMy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 20, 2005 at 04:34:49AM +0900, Ara.T.Howard wrote: > i don't think it is functional because the name of the function > cannot be used as a first class object. Well, that's true of Ruby in general. If you want to turn a method name into a first class object, you can do this: x = myarray.instance_method(:inject) x.call {|a,b| a+b} Or this: x = Array.instance_method(:inject) x.bind(myarray).call {|a,b| a+b} regards, Ed --CUfgB8w4ZwR/yMy5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDVqMlnhUz11p9MSARAlL7AJ9proe1ef9abiA1MQkHlIh5a8RDeQCgy0oT QWCyqVTjcdYHGpDZVLI2qLU= =W8FP -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5--