Skip to main content

Questions tagged [lexical-binding]

2 votes
1 answer
68 views

An let-binding takes a copy of a value and thus setf does not modify the structure where the value came from. (let ((x (list 1 2))) (let ((y (car x))) (setf y 7)) x) ; (1 2) rather than (7 2) ...
Post Self's user avatar
  • 163
2 votes
1 answer
279 views

Having heard that lexical binding may well become the default in Emacs 31, I wanted to start adding the "lexcial binding cookie" (ie. the lexical-binding: nil file local variable setting) to ...
q.undertow's user avatar
4 votes
2 answers
841 views

How can I enable lexical binding in an init.el file that is tangled from an org mode file? I have an org mode file called Emacs.org which is used to tangle the init.el file using the command M-x org-...
Gangula's user avatar
  • 419
0 votes
0 answers
24 views

I want to use a function that is taking advantage of lexical-binding: (defun comp (funcs) "Function composition" (let (f0 ff) (if (not funcs) (lambda (x &rest args) ...
dmw64's user avatar
  • 219
3 votes
1 answer
184 views

(let ((test 233)) (lambda ())) ;; ==> (closure ((test . 233) t) ;; ==> nil) I am wondering why not simply choose a proper alist, e.g.: ((test . 233)) ; instead of ((test . 233) t) As far ...
shynur's user avatar
  • 6,200
4 votes
0 answers
275 views

The GNU Emacs Lisp Reference Manual, 12.5 Defining Global Variables: If you use a defconst or defvar special form while the variable has a local binding (made with let, or a function argument), it ...
shynur's user avatar
  • 6,200
0 votes
1 answer
50 views

I am experimenting with writing elisp in a more scheme-y style where helper functions are definded inside another function's lexical envirnonment like this (with lexical binding turned on): (defun my-...
dandy's user avatar
  • 15
1 vote
1 answer
340 views

I would like to define a function that generates lambdas, as such: (defun my-func (FUNCTION) (lambda () (FUNCTION))) But when I evaluate the following (defun my-func1 () (message &...
Tian's user avatar
  • 288

15 30 50 per page