What is format in Lisp?

What is format in Lisp?

Format is a function in Common Lisp that can produce formatted text using a format string similar to the printf format string.

How do you print on a lisp?

The Output Functions

  1. prin1 returns the object as its value.
  2. print prints the object with a preceding newline and followed by a space. It returns object.
  3. pprint is just like print except that the trailing space is omitted.
  4. princ is just like prin1 except that the output has no escape character.

What is Terpri in Lisp?

Frill-free printing in LISP is achieved with print, prin1, princ and terpri. The simplest uses of print, prin1, and princ involve a single argument. Terpri, which produces a newline, can be called with no arguments. Prin1 is just like print except that it does not do a new line before printing. …

What does cond do in Lisp?

cond allows the execution of forms to be dependent on test-form. Test-forms are evaluated one at a time in the order in which they are given in the argument list until a test-form is found that evaluates to true. If there are no forms in that clause, the primary value of the test-form is returned by the cond form.

What is Princ Lisp?

write is the general entry point to the Lisp printer. prin1 produces output suitable for input to read . princ is just like prin1 except that the output has no escape characters. princ is intended to look good to people, while output from prin1 is intended to be acceptable for the function read .

How do I return a Lisp?

Remember, Lisp returns the value of whatever expr was last executed in a function as its value. If n==0 , the above returns 0. If n > 0 , it returns the result of the + expr.

What does cons mean in Lisp?

In computer programming, cons (/ˈkɒnz/ or /ˈkɒns/) is a fundamental function in most dialects of the Lisp programming language. cons constructs memory objects which hold two values or pointers to values. These objects are referred to as (cons) cells, conses, non-atomic s-expressions (“NATSes”), or (cons) pairs.

How do you increment a Lisp?

1 Answer. Use the built-in “+” or “-” functions, or their shorthand “1+” or “1-“, if you just want to use the result, without modifying the original number (the argument). If you do want to modify the original place (containing a number), then use the built-in “incf” or “decf” functions.

How do I run a Lisp function?

Step 1: After logging into a CUIT machine, enter “lisp” after the $ shell prompt and then hit . Another way is to run lisp via emacs: Meta-x run-lisp (i.e. hit ‘esc’ followed by ‘x’, type “run-lisp” and you’ll be in lisp mode from which you can load files of lisp code…)