Function Entry: PRINC
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: PRINC
Name
princ
Class
Function
Syntax
(princ [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 display-oriented: unlike prin1, control characters in a string expression are written verbatim (no \n / \t / escaped-double-quote rewriting). With no argument, (princ) returns the void symbol value and is the conventional way to terminate a defun without emitting anything.
Return Values
Returns the evaluated value of expression, or void with no argument.
Side Effects
Writes the printed representation to the command line or to fileHandle.
Examples
With (setq x 123):
(princ x)prints123to the command line and returns123.(princ x fh)writes123to file handlefhand returns123.
Tested Behaviour (BricsCAD V26 / macOS, 2026-04-26)
(princ "hello" file-desc) returns "hello" and writes the five characters hello to the file (no surrounding quotes, no trailing newline). Confirms the verbatim representation, distinct from prin1's round-trippable representation.
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 verbatim (no escape rewriting).
- Status: documented in both vendors and tested against BricsCAD V26 / macOS.
See Also
- probe-output.lsp — executable Phase-5 probe suite.
- probe results, BricsCAD V26 / macOS, 2026-04-26.
prin1for the round-trippable form.vl-princ-to-stringfor the string-returning companion.
Source Notes
- [princ (AutoLISP 2026)](https://help.autodesk.com/cloudhelp/2026/ENU/AutoCAD-AutoLISP-Reference/files/GUID-7DDA298B-A97C-49C9-94BA-46C77B50AE99.htm)
- [princ (BricsCAD V26 DevRef)](https://developer.bricsys.com/bricscad/help/en_US/V26/DevRef/source/princ.htm)
- Status: documented and product-tested (Phase 5 closure).