Function Entry: PRIN1

← Prev | ↑ Chapter | Next → | Index | Symbols

Function Entry: PRIN1

Name

prin1

Class

Function

Syntax

(prin1 [expression [fileHandle]])

Arguments and Values

  • expression (optional): any AutoLISP expression or value. If omitted, nil is used.
  • fileHandle (optional): handle of a file as obtained from (open …). If omitted or nil, output goes to the command line.

Description

Prints expression to the command line, or writes it to the open file fileHandle. The representation is machine-readable: control characters in a string expression (\t, \n, \r, the escaped double-quote, octal \nnn) are written as their backslash escape sequences so that the output round-trips through the reader.

Return Values

Returns the evaluated value of expression. With no argument, (prin1) returns the void symbol value, useful as the last form in a defun to emit "nothing" to the command line.

Side Effects

Writes the printed representation to the command line or to fileHandle.

Examples

With (setq x 123):

  • (prin1 x) prints 123 to the command line and returns 123.
  • (prin1 x fh) writes 123 to file handle fh and returns 123.

Tested Behaviour (BricsCAD V26 / macOS, 2026-04-26)

(prin1 "hello" file-desc) returns "hello" and writes the seven characters "hello" (the literal seven, including the surrounding double quotes — i.e. the round-trippable representation) to the file. The 2-argument form is fully accepted by BricsCAD V26.

Availability

  • AutoCAD 2026: documented (Autodesk reference page).
  • BricsCAD V26: documented + product-tested on macOS (probe suite, 2026-04-26). 2-argument form accepted; output is round-trippable.
  • Status: documented in both vendors and tested against BricsCAD V26 / macOS.

See Also