Function Entry: PRINT

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

Function Entry: PRINT

Name

print

Class

Function

Syntax

(print [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

Same behaviour as prin1 (control-character escapes; round-trippable representation), but with a leading newline before expression and an extra space afterwards.

Return Values

Returns the evaluated value of expression.

Side Effects

Writes one newline, the printed representation of expression, then a single trailing space.

Examples

With (setq x 123):

  • (print x) prints <newline>123 to the command line and returns 123.
  • (print x fh) writes <newline>123 to file handle fh and returns 123.

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

(print "hello" file-desc) returns "hello" and writes the nine characters \n"hello" (literal newline, then the round-trippable seven characters of prin1, then a single trailing space) to the file. Confirms the framing rule from the vendor page.

Availability

  • AutoCAD 2026: documented (Autodesk reference page).
  • BricsCAD V26: documented + product-tested on macOS (probe suite, 2026-04-26). Leading-newline / trailing-space framing confirmed empirically.
  • Status: documented in both vendors and tested against BricsCAD V26 / macOS.

See Also

clautolisp: how a real prints

As prin1 (see its "Measured" and "clautolisp" notes): the AutoCAD dialects print a real as AutoCAD (0.333333), the BricsCAD dialects as BricsCAD (0.333333333333333), clautolisp / strict / lax in clautolisp's own spelling; a [real-format] notice the first time the products differ.

clautolisp: an explicit NIL file

clautolisp implementation deviation – not part of the normative specification above. (print x nil) follows the same per-dialect rule as princ (see its "Tested Behaviour (explicit NIL file)" and "clautolisp: an explicit NIL file"): an error and a [printer-nil-file] warning under --dialect autocad, as AutoCAD 2022 does; output to the command line, warned under --strict, silent under the other dialects.