Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The good manual is <a href="http://gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html" rel="nofollow">Chapter 21 of PCL</a>.</p> <p>Answering your questions briefly:</p> <ul> <li><p>keywords are exported <strong>symbols</strong> in <code>keyword</code> package, so you can refer to them not only as <code>:a</code>, but also as <code>keyword:a</code></p></li> <li><p>keywords in function argument lists (called <code>lambda-list</code>s) are, probably, implemented in the following way. In presence of <code>&amp;key</code> modifier the <code>lambda</code> form is expanded into something similar to this:</p> <pre><code>(let ((key-param (getf args :key-param))) body) </code></pre></li> <li><p>when you use a keyword to name a package it is actually used as a <code>string-designator</code>. This is a Lisp concept that allows to pass to a certain function dealing with strings, that are going to be used as symbols later (for different names: of packages, classes, functions, etc.) not only strings, but also keywords and symbols. So, the basic way to define/use package is actually this:</p> <pre><code>(defpackage "KEY-PARAM" ...) </code></pre> <p>But you can as well use:</p> <pre><code>(defpackage :key-param ...) </code></pre> <p>and</p> <pre><code>(defpackage #:key-param ...) </code></pre> <p>(here <code>#:</code> is a reader macro to create uninterned symbols; and this way is the preferred one, because you don't create unneeded keywords in the process).</p> <p>The latter two forms will be converted to upper-case strings. So a keyword stays a keyword, and a package gets its named as string, converted from that keyword.</p></li> </ul> <p>To sum up, keywords have the value of themselves, as well as any other symbols. The difference is that keywords don't require explicit qualification with <code>keyword</code> package or its explicit usage. And as other symbols they can serve as names for objects. Like, for example, you can name a function with a keyword and it will be "magically" accessible in every package :) See @Xach's <a href="http://xach.livejournal.com/301076.html" rel="nofollow">blogpost</a> for details.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload