Skip to content

defun

(defun name (arguments [/ locals]) expression...)

Defines a function. The arguments and the local variables (after /) get their previous value back on exit; other variables are global. Returns the name. If the name starts with C:, the function becomes a command.

(defun double (x) (* 2 x))
(double 4)   ; 8

Download LinceCAD Manual contents