2017年9月10日 星期日

Writing GNU Emacs Extensinos Chapter 1 - Customizing Emacs

In Lisp, functions are named with symbols. Smbols are like function names or varible names in other language, althought Lisp allows a wider variety of characters in symbols than most languages allow in their variable names

If a symbol appears in the first position of a list, it's the name of a function to execute. If it appears elsewhere, it's a variable whose value needs to be retrieved.

The way to prevent a symbol (or any Lisp expression) from being evaluated is to quote it by preceding iw with a a single quote(')

Symbols aren't the only things that may follow a ' character; any Lisp expression can be quoted, including lists, numbers, strings, and other kinds of expresssions

In Lisp, strings are self-evluating, which means that when the string is evaluated, the result is the string itself. So quoting it, while harmless, is redundant. Numbers, characters, and vectors are other types of self-evaluating Lisp expressions

Sexp is an abbreviation for S-expression, which in turn is short for symbolic expression, which is another name of "Lisp expression"

沒有留言:

張貼留言