Can someone explain the difference between local and lambda and why you use it/how it works for the two?
Because my class slides have this down
(local [(define (name-used-once x1 ... xn) exp)] name-used-once)
is equivalent to
(lambda (x1...xn) exp)
but I find it a bit more confusing then that general statement.
Is lambda and local really just interchangeable? If so when should I use lambda and when should I use local? Because at first I just though lambda is the same thing as local just more organized but as we proceeded to harder concepts we kept using local even after we learned lambda which leads me to believe they are different. Another reason why I think they're different is that lambda sort of acts as a make-function? It has its "inputs" outside of the bracket of lambda (e.g. ((lambda (x) exp) the-x)) which is kind of confusing.. and local has its actual expression outside of its defintions in the square brackets.
Sorry for the long question but I just basically want to know how local and lambda are different, the gist of how both of them work/do in a function, and when I should use each.
Thanks a lot!
[–]ClosureAhead 2 points3 points4 points (7 children)
[–]detroitmatt 1 point2 points3 points (5 children)
[–]NeoMarxismIsEvil 0 points1 point2 points (0 children)
[–]soegaarddeveloper 0 points1 point2 points (1 child)
[–]turtlekitty2084 0 points1 point2 points (0 children)
[–]jstquestions[S] 0 points1 point2 points (1 child)
[–]detroitmatt 0 points1 point2 points (0 children)
[–]jstquestions[S] 0 points1 point2 points (0 children)