((h2 (@ (id . "syntax-of-lists")) "Syntax of lists") (p "A list always starts with the left parenthesis (" (@L (@H "“") (kbd "(") (@H "”")) ", U+0028) and ends with a right parenthesis (" (@L (@H "“") (kbd ")") (@H "”")) ", U+0029)." " " "A list may contain a possibly empty sequence of elements, i.e. lists and / or atoms.") (p "Internally, lists are composed of " (em "cells") "." " " "A cell allows to store two values." " " "The first value references the first element of a list." " " "The second value references the rest of the list, or is the special value " (em "nil") " if there is no rest of the list.") (p "However, it is possible to store an atom as the second value of the last cell." " " "In this case, before the last element of a list of at least two elements, a full stop character (" (@L (@H "“") (kbd ".") (@H "”")) ", U+002E) signals such a cell as the last two elements." " " "This allows a more space economic storage of data.") (p "A " (em "proper") " list, which contains " (em "nil") " as the second value of the last element might be pictured as follows:") (p (@H "VNVNVElem1Elem2ElemN")) (p (kbd "V") " is a placeholder for a value, " (kbd "N") " is the reference to the next cell (also known as the rest / tail of the list)." " " "Above list will be represented as an symbolic expression as " (kbd "(Elem1 Elem2 ... ElemN)")) (p "An improper list will have a non-" (em "nil") " reference to an atom as the very last element") (p (@H "VNVNVVElem1Elem2ElemNAtom")) (p "Above improper list will be represented as an symbolic expression as " (kbd "(Elem1 Elem2 ... ElemN . Atom)")) (h2 (@ (id . "syntax-of-numbers-atom")) "Syntax of numbers (atom)") (p "A number is a non-empty sequence of digits (" (@L (@H "“") "0" (@H "”")) " ... " (@L (@H "“") "9" (@H "”")) ")." " " "The smallest number is " (code "0") ", there are no negative numbers.") (h2 (@ (id . "syntax-of-symbols-atom")) "Syntax of symbols (atom)") (p "A symbol is a non-empty sequence of printable characters, except left or right parenthesis." " " "Unicode characters of the following categories contains printable characters in the above sense: letter (L), number (N), punctuation (P), symbol (S)." " " "Symbols are case-sensitive, i.e. " (@L (@H "“") (kbd "ZETTEL") (@H "”")) " and " (@L (@H "“") (kbd "zettel") (@H "”")) " denote different symbols.") (h2 (@ (id . "syntax-of-string-atom")) "Syntax of string (atom)") (p "A string starts with a quotation mark (" (@L (@H "“") (kbd "\"") (@H "”")) ", U+0022), contains a possibly empty sequence of Unicode characters, and ends with a quotation mark." " " "To allow a string to contain a quotations mark, it must be prefixed by one backslash (" (@L (@H "“") (kbd "\\") (@H "”")) ", U+005C)." " " "To allow a string to contain a backslash, it also must be prefixed by one backslash." " " "Unicode characters with a code less than U+FF are encoded by by the sequence " (@L (@H "“") (kbd "\\xNM") (@H "”")) ", where " (kbd "NM") " is the hex encoding of the character." " " "Unicode characters with a code less than U+FFFF are encoded by by the sequence " (@L (@H "“") (kbd "\\uNMOP") (@H "”")) ", where " (kbd "NMOP") " is the hex encoding of the character." " " "Unicode characters with a code less than U+FFFFFF are encoded by by the sequence " (@L (@H "“") (kbd "\\UNMOPQR") (@H "”")) ", where " (kbd "NMOPQR") " is the hex encoding of the character." " " "In addition, the sequence " (@L (@H "“") (kbd "\\t") (@H "”")) " encodes a horizontal tab (U+0009), the sequence " (@L (@H "“") (kbd "\\n") (@H "”")) " encodes a line feed (U+000A).") (h2 (@ (id . "see-also")) "See also") (ul (li (p "Currently, Zettelstore uses " (a (@ (href . "https://t73f.de/r/sx") (rel . "external")) "Sx") " (" (@L (@H "“") "Symbolic eXpression framework" (@H "”")) ") to implement symbolic expressions." " " "The project page might contain additional information about the full syntax.") (p "Zettelstore only uses lists, numbers, string, and symbols to represent zettel."))))