Subject: Re: My LOOP is ugly
From: (Rob Warnock)
Date: Sun, 25 Apr 2004 06:30:15 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Pascal Costanza  <> wrote:
| Recently I needed this, and found it very cool:
|   (incf (getf plist key 0))
| This means: If the key is not bound in plist yet, assume 0 as its 
| default value.

And to bring this back around to hash tables (which the very
first responses in this thread suggested), for certain kinds
of text-processing tasks[1] I find myself doing this:

    (incf (gethash key ht 0))

or this:

    (push value (gethash key ht))	; NIL is fine as a default here


[1] Histograms, checking for uniqueness, etc.

Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607