Numbers
|
Parses an integer from a string |
|
Truncates toward negative/positive infinity |
|
Rounds to the nearest integer |
|
Modulus/remainder of a truncating division |
|
Returns a new value (inc/dec)remented by a number |
|
Macros to (inc/dec)rement in place |
|
Mathematical value equality (types ignored) |
|
Order comparison |
Strings
|
Returns a formatted output string when the destination is nil
|
Sequences
|
Access elements with an integer index |
|
|
Count the appearances of an element |
|
Finds an item or returns nil
|
|
The first index of an element |
|
Returns the start position of a sequence in another sequence |
|
Removes all the occurrences of an item |
|
Replaces all occurrences of an item |
Lists
|
Successively applies a function to each element of a list |
|
Like mapcar
, but its function receives a cons cell instead of its element (therefore, the function has access to the rest of the list) |
|
Like mapcar
, but the results are combined into a list |
|
Like mapcan
, but applied to maplist
|
|
|
Things to remember
Object Oriented |
All values in a Common Lisp program are instances of some class. Furthermore, all classes are organized into a single hierarchy rooted at the class T
. |
Starting a project |
|
Equality
|
Object identity (don't use with numbers or chars) |
|
Considers equivalent two objects of the same class with the same numeric or char value |
|
Lists with the same structure and contents, strings with the same characters |
|
Ignores differences in case or in numerical type ( 1 == 1.0
) |
Functions
|
|
Returns an anonymous function |
|
Immediately returns a value from a function (or a block
) |
|
Invokes a function from a function object |
|
Works like funcall
, but receives the arguments as a list |
|
Different ways to capture function arguments |
Standard Control Constructs
|
The else form is optional |
|
Like if
, but returns nil
if the condition is falsy and evaluates multiple body forms |
|
Like when
, but executes its body only when the condition is falsy |
IO
|
Produces formatted output to stdout when the destination is t
|
|
|
Interpolate argument in human readable format; interpolate as Lisp readable |
|
Newline; newline if not at the beginning of a line |
Object-Oriented
|
Defines an abstract operation (polymorphism) |
|
Defines an implementation of a generic function |
|
Similar to an invocation to a super-class method |
|
New named class; some slot options are: :reader
, :writer
, :accessor
, :initarg
, :initform
, :documentation
, :allocation
|
|
Returns the value of slot in the object ( setf
-able) |
|
Binds a slot/accessor to a symbol that can be used in its body |
|
Created By
boechat107.github.io
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets