this post was submitted on 15 Nov 2023
1 points (100.0% liked)
Emacs
311 readers
3 users here now
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
Get Emacs
Rules
- Posts should be emacs related
- Be kind please
- Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.
Emacs Resources
Emacs Tutorials
- Beginner’s Guide to Emacs
- Absolute Beginner's Guide to Emacs
- How to Learn Emacs: A Hand-drawn One-pager for Beginners
Useful Emacs configuration files and distributions
Quick pain-saver tip
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
As elisp is a dynamic language, it looks up these functions when needed. You can try it: E.g., evaluate this in the scratch buffer (
C-x C-e
):This works even though
testfn2
is not defined. However, evaluating(testfn1)
(actually calling the function) will give you an error astestfn2
is not found.When you define
testfn2
, it is added to the global scope and thus becomes available fortestfn1
.Now,
(testfn1)
works.You can even define a new version of
testfn2
which does something different. This way you can change any function in a lisp environment (this generally applies for scripting languages). This way also circular references are no problem. There may be warnings, when byte compiling functions with undefined references, but these are just warnings and compiling still works. If you look at a byte-compiled elisp file, you still see symbolic references to the called functions.