Content deleted Content added
No edit summary |
No edit summary |
||
Line 6:
Some languages, such as [[PostScript]], are extremely liberal in this approach, allowing core keywords to be redefined for specific purposes.
In [[Common Lisp]], the term "keyword" (or "keyword symbol") is used for a special sort of [[symbol (Lisp)|symbol]], or identifier. Unlike other symbols, which usually stand for variables or functions, keywords are self-[[Lisp (programming language)#Self-evaluating forms and quoting|quoting]] and self-evaluating<ref>[[Peter Norvig]]: ''Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp'', Morgan Kaufmann, 1991, ISBN 1-55860-191-0, [http://norvig.com/paip.html Web]</ref><sup>:98</sup> and are [[String interning|interned]] in the <tt>KEYWORD</tt> package.<ref>[http://www.lispworks.com/documentation/HyperSpec/Body/t_kwd.htm#keyword ''Type'' '''KEYWORD'''] from the [[Common Lisp HyperSpec]]</ref> Keywords are usually used to label named arguments to functions, and to represent symbolic values.
Languages vary as to what is provided as a keyword and what is a [[library routine]]. Some languages, for instance, provide keywords for input/output operations whereas in others these are library routines. In [[Python (programming language)|Python]] (versions earlier than 3.0) and many [[BASIC]] dialects, <code>print</code> is a keyword. In contrast, the C and Lisp equivalents <code>printf</code> and <code>format</code> are functions in the standard library.
|