From: ············@gmail.com
Subject: Need help on a lisp problem please ....
Date: 
Message-ID: <1184829006.887105.296520@e16g2000pri.googlegroups.com>
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 ?
From: Tamas Papp
Subject: Re: Need help on a lisp problem please ....
Date: 
Message-ID: <878x9cuagm.fsf@pu100877.student.princeton.edu>
············@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