Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
[[tags: manual]] [[toc:]] == Module (chicken keyword) Keywords are written like symbols, but prefixed with {{#:}}. They evaluate to themselves. While they behave a lot like symbols in that they are interned when read and can be compared in constant time with {{eq?}}, they are a distinct type. In particular, they have no plist, they cannot be bound or assigned to and aren't {{eq?}} to a symbol with the same spelling. Procedures can use keywords to accept optional named parameters in addition to normal required parameters. The parameter {{keyword-style}} and the compiler/interpreter option {{-keyword-style}} can be used to allow an additional keyword syntax, either compatible to Common LISP, or to DSSSL. As long as this parameter is set to {{#:suffix}}, CHICKEN conforms to [[http://srfi.schemers.org/srfi-88/srfi-88.html|SRFI-88]]. There is also a {{srfi-88}} or {{(srfi 88)}} module which only includes the standard procedures from the SRFI document, without the CHICKEN extensions. {{(chicken keyword)}} offers the complete set of procedures, both CHICKEN-specific and standard SRFI-88. ==== get-keyword <procedure>(get-keyword KEYWORD ARGLIST [THUNK])</procedure> Returns the argument from {{ARGLIST}} specified under the keyword {{KEYWORD}}. If the keyword is not found, then the zero-argument procedure {{THUNK}} is invoked and the result value is returned. If {{THUNK}} is not given, {{#f}} is returned. <enscript highlight=scheme> (define (increase x . args) (+ x (get-keyword #:amount args (lambda () 1))) ) (increase 123) ==> 124 (increase 123 #:amount 10) ==> 133 </enscript> ==== keyword? <procedure>(keyword? X)</procedure> Returns {{#t}} if {{X}} is a keyword, or {{#f}} otherwise. ==== keyword->string <procedure>(keyword->string KEYWORD)</procedure> Transforms {{KEYWORD}} into a string. ==== string->keyword <procedure>(string->keyword STRING)</procedure> Returns a keyword with the name {{STRING}}. --- Previous: [[Module (chicken irregex)]] Next: [[Module (chicken load)]]
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 16 from 0?