Keyword (computer programming): Difference between revisions

Content deleted Content added
JAnDbot (talk | contribs)
m r2.5.2) (robot Removing: vi:Từ khoá
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 evaluateself-evaluating.<ref>[[Peter toNorvig]]: themselves''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> 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.
Line 13:
 
In languages with [[macro (computer science)|macros]] or [[lazy evaluation]], control flow constructs such as <code>if</code> can be implemented as macros or functions. In languages without these expressive features, they are generally keywords.
 
==References==
<references/>
 
==See also==