Demonstrate usage of a lambda function in a let expression
This commit is contained in:
parent
3556a128ec
commit
7335c0fc95
|
@ -300,6 +300,15 @@ My vertico-repeat setup.
|
|||
")")))
|
||||
")")))))
|
||||
,#+end_example
|
||||
* Define a lambda in a let expression
|
||||
|
||||
#+begin_src elisp :tangle gists/let-lambda.el
|
||||
(let ((f (lambda (s) (message s))))
|
||||
;; f is a variable so should be treated as such.
|
||||
(funcall f "This works.")
|
||||
|
||||
;; f is not a function so cannot be found if called like this.
|
||||
(f "This does not work."))
|
||||
#+end_src
|
||||
|
||||
* Meta
|
||||
|
|
6
gists/let-lambda.el
Normal file
6
gists/let-lambda.el
Normal file
|
@ -0,0 +1,6 @@
|
|||
(let ((f (lambda (s) (message s))))
|
||||
;; f is a variable so should be treated as such.
|
||||
(funcall f "This works.")
|
||||
|
||||
;; f is not a function so cannot be found if called like this.
|
||||
(f "This does not work."))
|
Loading…
Reference in a new issue