manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.5.35 SRFI-88 Keyword Objects

SRFI-88 provides keyword objects, which are equivalent to Guile’s keywords (see section Keywords). SRFI-88 keywords can be entered using the postfix keyword syntax, which consists of an identifier followed by : (see section postfix keyword syntax). SRFI-88 can be made available with:

(use-modules (srfi srfi-88))

Doing so installs the right reader option for keyword syntax, using (read-set! keywords 'postfix). It also provides the procedures described below.

Scheme Procedure: keyword? obj

Return #t if obj is a keyword. This is the same procedure as the same-named built-in procedure (see section keyword?).

(keyword? foo:)         ⇒ #t
(keyword? 'foo:)        ⇒ #t
(keyword? "foo")        ⇒ #f
Scheme Procedure: keyword->string kw

Return the name of kw as a string, i.e., without the trailing colon. The returned string may not be modified, e.g., with string-set!.

(keyword->string foo:)  ⇒ "foo"
Scheme Procedure: string->keyword str

Return the keyword object whose name is str.

(keyword->string (string->keyword "a b c"))     ⇒ "a b c"

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

This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2019
Individual documents may contain additional copyright information.