I'm trying to use "let" for functions so I can apply a small function
several times without using defun inside my main function .
Example :
(let (
(fn (lambda (a) (< a 3))
)) (fn 2)) .
Could you please tell me the right way to do this ?
············@gmail.com writes:
> I'm trying to use "let" for functions so I can apply a small function
> several times without using defun inside my main function .
> Example :
> (let (
> (fn (lambda (a) (< a 3))
> )) (fn 2)) .
> Could you please tell me the right way to do this ?
Use flet or labels for functions, the latter allows functions to call
each other or themselves (recursion).
See
http://www.lispworks.com/documentation/HyperSpec/Body/s_flet_.htm
http://gigamonkeys.com/book/the-special-operators.html#manipulating-the-lexical-environment
HTH
Tamas