Category Archives: Lisp

Lisp lists and destructive functions

Table of Contents 1. nil and non-nil 2. cons cell 3. cons cells in diagrams 4. lists 5. improper lists and proper lists 6. check for empty list, non-empty list, list 7. sequence 8. literal list 9. shared structure 10. … Continue reading

Posted in Emacs, Lisp | Tagged , | Leave a comment

Names and things (reference semantics) vs. boxes and things (value semantics)

Table of Contents 1. Motivation 2. Alfie Bobbie thought experiment 3. The aa bb experiment (back to Snippet 20) 4. Boxes containing object references 5. Two different meanings of change 6. Pass by value or pass by reference 7. With … Continue reading

Posted in Emacs, Lisp, Python | Tagged , , | 1 Comment

It is not hard to edit Lisp code

Table of Contents 1. Intro 2. Which editor or IDE to use 3. The three phases 4. Always indent. 5. Evaluate! 6. One liners 7. Breaking lines 8. Joining lines 9. Placement of close parens 10. The “No red tape” … Continue reading

Posted in Emacs, Lisp | Tagged | 2 Comments

It is not hard to read Lisp code

Table of Contents 1. Intro 2. Tree view 3. Terminology 3.1. Emacs Lisp note 3.2. Common Lisp note 4. Variations 5. How to find where the expression ends. 6. Some difference from Python 7. Tools 8. Logical operators being used … Continue reading

Posted in Emacs, Lisp | Tagged , | 4 Comments

Checking Windows version with Emacs Lisp

elisp code example for programmatically checking the version of Microsoft Windows on which Emacs is running: (when (eq system-type ‘windows-nt) (print “Hello, MS Windows.”) (let ((winversion (when (string-match (rx “nt” (group (+ digit)) “.” (group (+ digit)) “.” (+ digit) … Continue reading

Posted in Emacs, Lisp | Tagged , | Leave a comment

how to list emacs package dependencies

Table of Contents 1. how to see one-level dependencies of a package 2. how to programmatically collect the names of all the required packages for a given set of packages For now there is no command or function that recursively … Continue reading

Posted in Emacs, Lisp | Tagged , | 3 Comments

default argument in Python and Lisp

Table of Contents the Python mutable default argument gotcha how to give default arguments in Lisp comparing Lisp and Python the None trick and the nil trick further reading optional reading more on the Python gotcha the gotcha will get … Continue reading

Posted in Emacs, Lisp, Python | Tagged , , | Leave a comment