About Making Functions Available to Documents and Other Applications (Visual LISP IDE)

By default, functions defined in a separate-namespace VLX are not exposed to the document or other application namespaces.

Note: The Visual LISP IDE is available on Windows only.

You must use the vl-doc-export function to expose functions to the document and other application namespaces. When issued from a VLX file that runs in its own namespace, vl-doc-export exposes the specified function to any namespace that loads the VLX file. The vl-doc-export function accepts a single argument, a symbol identifying the function name.

For example, look at the following code:

(vl-doc-export 'kertrats)
(defun kertrats ()
  (princ "This function goes nowhere") 
)

This example defines a function named kertrats, which simply prints a message. The defun for the function is preceded by a vl-doc-export call that causes the function to be exported.

You can use the vl-list-loaded-vlx function to return a list of all separate-namespace applications associated with the current document, and use the vl-list-exported-functions function to determine what functions have been exported from a separate-namespace application into the current document.

The following shows which separate-namespace applications are associated with the current document:

(vl-list-loaded-vlx)
(DOCTEST)

The following command returns a list of the functions exported by the doctest application:

(vl-list-exported-functions "doctest")
("KERTRATS")
Note: If separate namespace VLX A is associated with document A loads separate namespace VLX B, then all of VLX B's exported functions are automatically defined in document A. Note also that VLX B's exported functions are not defined in VLX A until VLX A issues an explicit import.

Using an exported function with another application

Functions defined in one separate-namespace VLX are not exposed to any other separate-namespace VLX applications. If a function has been exported through vl-doc-export, you can use the vl-doc-import function to make the function available to another separate-namespace VLX.