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

Started by Dmi, September 05, 2006, 02:10:08 PM

Previous topic - Next topic

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

#1
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

#2
Thanks!
WBR, Dmi