on function...
Posted: Sat Nov 10, 2012 10:44 am
HI
It seems that I still have some doubt on ‘function’ operator..
For example some code that I’m learning on the book (and also on the web)use it with lambda:
In compose definition:
but that code works also without function in front of lambda …of course CL interpreter to know that lambda is a function and not a variable…
it’s the same also for reduce, apply, setf,..ecc
Have I misunderstood something? (maybe yes.... )
Thanks in AV
It seems that I still have some doubt on ‘function’ operator..
For example some code that I’m learning on the book (and also on the web)use it with lambda:
In compose definition:
Code: Select all
(defun compose (&rest fns)
(destructuring-bind (fnl . rest) (reverse fns)
#'(lambda (&rest args)
(reduce #'(lambda (v f) (funcall f v))
rest :initial-value (apply fnl args)))))
it’s the same also for reduce, apply, setf,..ecc
Have I misunderstood something? (maybe yes.... )
Thanks in AV