To learn any knowledge, you must not simply consider them as knowledge. More importantly, you must apply them to practical programming practices, holding this learning concept will not turn you into an academic dictionary. This is especially important for programmers. Any language knowledge you have learned, you must keep practicing and practicing in the actual programming process, and get a glimpse of it on paper.
Lispbox actually integrates Emacs, slime, clozure Cl, and quicklisp. the development environment using lispbox is equivalent to choosing Emacs as the editor and slime as the interaction interface, you must be familiar with the various shortcut keys of Emacs and slime. This not only improves your learning and development process, but also gives you an efficient and uninterrupted keyboard job.
In Common LISP, the format function is more commonly used to output to the screen. You can compare it with the printf function of C language. Pay attention to the parameter "T" in format ", it indicates the standard output stream: * standard-output *. That is to say, if you replace a parameter in the T bit, we can also send this greeting to any specified output stream.
(Format t "Hello, world! ")
This structure is a list surrounded by parentheses. There are three elements in it. These elements are separated by spaces. However, spaces in double quotation marks are processed as string content and cannot be separated, obviously, format is a special symbol. It is a function name, and the two elements that follow it are its parameters.
In Emacs, the shortcut for querying History commands is m-P. Here, uppercase M indicates the Alt key, and m-P means to press both the Alt key and the P key.
M-P is up
M-N is to flip down
C-A is the shortcut key for moving the cursor to the beginning of the line. Here, uppercase c Indicates Ctrl, and C-a means pressing CTRL and A at the same time.
C-e is the shortcut key for moving the cursor to the end of the line.
Standard syntax format defined by defun functions:
(Defun name (parameter *)
"Optional function description"
Body-form *)
Parameter * Indicates 0 or more parameter. Here * is a regular syntax symbol, indicating 0 or more Parameter
Body-form * Indicates 0 or multiple body-forms.
(Defun function name (parameter *)
"Optional function description"
Form body *)