All Manuals > LispWorks User Guide and Reference Manual > 42 Java classes and methods

NextPrevUpTopContentsIndex

com.lispworks.LispCalls.checkLispSymbol

Method

public static boolean checkLispSymbol(String name, boolean fboundp)

Description

Checks whether a Lisp symbol exists, and optionally whether it is fbound.

name specifies the name of the Lisp symbol. The string name is parsed in a simple way, rather than using the Lisp reader. The parsing involves:

  1. Upcase the string.
  2. If there is a colon, take the part before it as a package name. Otherwise use "COMMON-LISP-USER" as the package name.
  3. If the colon is followed by another colon, skip it and set a flag allowing internals. Otherwise, set a flag allowing only externals.
  4. Take the rest of the string as the symbol name.
  5. Find the package from the package name.
  6. Find the symbol using the package and the symbol name. If it is internal, use it only if the flag allowing internal was set.
  7. If fboundp is true, check whether the symbol is fbound.

If all these steps succeed, checkLispSymbol returns true. Otherwise it returns false.

For symbols with names that do not need escaping, the result is the same normal processing by the Lisp reader without interning when there is no symbol.

checkLispSymbol caches the results in the Java side, which means that if the symbol appears or gets defined after the first call to checkLispSymbol it may return the wrong result.

See also

Calling from Java to Lisp
init-java-interface
define-lisp-proxy
deliver


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex