Consider 2 Scheme functions
; Define function
(define (square n) (* n n ))
(square 12)
144
; Another way to define same function
(define square (lambda (n) (* n n)))
(square 12)
144
Both seem to produce the same result.
Is there any functional difference between these function declarations? Should one be preferred over another in some situations?
There is no difference between the two definitions – the former is syntactic sugar for the latter.
Which one you prefer is a matter of style, but my impression is that the former is generally the preferred way of defining functions as it is somewhat more succinct and perhaps also more readable.
Introductory texts often use the latter to make it clear that a named function is simply a variable holding a lambda – something that’s not that clear when using the first variant.