(fn ...) vs '(lambda ...)

For the Compleat Fan
Locked
Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

(fn ...) vs '(lambda ...)

Post by Dmi »

Guys!

How can be properly described the _practical_ difference between using:
(fn (x) (do-something-with x))
versus
'(lambda (x) (do-something-with x))
?
Now I finishing a brief introduction to newLISP (in Russian), targeted to non-LISP programmers. I need the proper words here to consolidate two of my examples...
WBR, Dmi

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

There is really no difference. 'fn' was simply introduced as a convenient shorter writing of lambda. Specially when writing expressions like (map (fn (x) .....) it is much easier to read and write. Internally both translate to the same thing.

Also math oriented people like it, because it is a usual abbreviation for 'function' used in math. 'lambda' is just the traditional word used in LISP and stands for Lambda Calculus, which was a math formalism introduced by Alonso Church.

Lutz

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Thanks!
WBR, Dmi

Locked