Google News
logo
Lisp - Interview Questions
What are the two pre-defined packages used in LISP?
In Common Lisp, which is a dialect of Lisp, there are two pre-defined packages that are commonly used:

1. COMMON-LISP package :
   * The COMMON-LISP package is the primary package used in Common Lisp.
   * It contains a large number of built-in functions, macros, and symbols that are part of the Common Lisp language specification.
   * This package is automatically available when you start a Common Lisp environment.
   * It includes commonly used functions like `car`, `cdr`, `cons`, `if`, `loop`, `defun`, `setq`, and many more.

2. KEYWORD package :
   * The KEYWORD package is another pre-defined package in Common Lisp.
   * It provides a set of symbols that are used as keywords or indicators in Lisp programs.
   * Symbols in the KEYWORD package are typically used as named parameters in function calls or as indicators in special constructs.
   * Symbols in this package start with a colon (`:`) followed by the symbol name.
   * Examples of symbols in the KEYWORD package include `:if`, `:else`, `:key`, `:name`, `:size`, etc.

These two pre-defined packages, COMMON-LISP and KEYWORD, are widely used in Common Lisp programming. The COMMON-LISP package provides the core functionality of the language, while the KEYWORD package offers a set of predefined keywords that enhance expressiveness and readability in Lisp code.
Advertisement