From: Joe Cheng Date: 2005-07-26T11:48:58+09:00 Subject: Re: Lisp on Lines zak.wilson@gmail.com wrote: >It's the same in Lisp. In your first example, "test".length gets >evaluated, and that value is assigned to a: > >Ruby: >a = "test".length >a.class #Fixnum >a #4 > >a = lambda {"test".length} >a.class #Proc >a.call() #4 > >Lisp: >(setf a (length "test")) >(a) ;error >(type-of a) ;(INTEGER 4 4) >a ;4 > >(setf a (lambda () (length "test"))) >(type-of a) ;EVAL:INTERPRETED-FUNCTION >(funcall a) ;4 > > Sorry, please bear with me... the Lisp I had in mind was more like: (setf a #'length) (funcall a "foo") (Hard to make an exact parallel because Ruby has methods not functions, and Lisp AFAIK has functions not methods...?) Setting a variable to the function itself seems pretty different than wrapping a call to the function in a lambda, but honestly, now I can't think of what the actual implications would be... other than a little bit of additional terseness in calls like (reduce #'+ '(1 2 3)) vs. [1, 2, 3].inject {|a,b|a+b} Are they really, for all intents and purposes, the same?