Nyquist / XLISP 2.0  -  Contents | Tutorials | Examples | Reference

keywordp


Type:   -   Lisp function (closure)
Source:   -   sal-parse.lsp

Syntax

(keywordp expr)
expr - an arbitrary Lisp expression
returns -  T  if the expression is a keyword symbol, NIL otherwise

(defun keywordp (s)
  (and (symbolp s)
       (eq (type-of (symbol-name s)) 'string)
       (equal (char (symbol-name s) 0) #\:)))

Description

The 'keywordp' function tests if a lisp expression is a keyword symbol.

Examples

(keywordp :a)   => T
(keywordp :B)   => T
(keywordp 'c)   => NIL
(keywordp "d")  => NIL
(keywordp #\e)  => NIL
(keywordp 123)  => NIL

  Back to Top


Nyquist / XLISP 2.0  -  Contents | Tutorials | Examples | Reference