Please enable JavaScript.
Coggle requires JavaScript to display documents.
Lisp Questions (Arithmetic Functions ('+' Function (Number of…
-
ANSI Common Lisp Ideas
-
Expressions Part 1
In lisp, everything that returns a value when typed in the toplevel is an expression.
'1' is an example of a lisp expression, because it returns : '1'. We could also say that '1' evaluates to '1'.
-
When an expression like '1' returns '1', we can say that the expression evaluates to itself.
Parts of an expression
In a complex expression such as (+ 4 1) the + is what we call an operator, and the numbers 4 and 1 are its arguments. The parentheses define where a complex expression starts and where it ends.
-
Prefix notation
In computer science, we use the phrase "prefix notation" to describe the rule of operators coming before their arguments.
-
In Lisp, the operator + can take any number of arguments, including zero. For example, (+) will return 0, and (+ 5) will return 5. This applies to many other Lisp functions, and it's thanks to prefix notation.
-
-
-
In lisp, parentheses tell us when an expression starts and where it ends. This feature makes it convenient to use prefix notation.
-