www.delorie.com/gnu/docs/guile/guile_213.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.7.5 Keyword Primitives

Internally, a keyword is implemented as something like a tagged symbol, where the tag identifies the keyword as being self-evaluating, and the symbol, known as the keyword's dash symbol has the same name as the keyword name but prefixed by a single dash. For example, the keyword #:name has the corresponding dash symbol -name.

Most keyword objects are constructed automatically by the reader when it reads a token beginning with #:. However, if you need to construct a keyword object programmatically, you can do so by calling make-keyword-from-dash-symbol with the corresponding dash symbol (as the reader does). The dash symbol for a keyword object can be retrieved using the keyword-dash-symbol procedure.

Scheme Procedure: make-keyword-from-dash-symbol symbol
C Function: scm_make_keyword_from_dash_symbol (symbol)
Make a keyword object from a symbol that starts with a dash.

Scheme Procedure: keyword? obj
C Function: scm_keyword_p (obj)
Return #t if the argument obj is a keyword, else #f.

Scheme Procedure: keyword-dash-symbol keyword
C Function: scm_keyword_dash_symbol (keyword)
Return the dash symbol for keyword. This is the inverse of make-keyword-from-dash-symbol.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003