fnil
fnil is a function in the Common Lisp programming language. It is used to provide a default value if a variable or expression evaluates to nil. The function takes two arguments: a default value and an expression. If the expression evaluates to nil, fnil returns the default value; otherwise, it returns the result of the expression. This can be useful for simplifying code that would otherwise require explicit checks for nil. For example, instead of writing (if my-variable my-variable nil-value), one could write (fnil nil-value my-variable). This makes the code more concise and potentially easier to read. fnil is a macro, meaning it is expanded at compile time rather than runtime. This allows for optimizations and ensures that the default value is only evaluated when necessary. It is part of the Common Lisp Object System (CLOS) and is often used in conjunction with other CLOS features.