Subject: Re: There's Gotta Be A Better Way #3: To One Or Not To One
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 20 Dec 2006 18:01:37 -0600
Newsgroups: comp.lang.lisp
Message-ID: <QNednWc_ytx8UxTYnZ2dnUVZ_uiknZ2d@speakeasy.net>
Ron Garret  <rNOSPAMon@flownet.com> wrote:
+---------------
| rpw3@rpw3.org (Rob Warnock) wrote:
| > Ron Garret  <rNOSPAMon@flownet.com> wrote:
| > +---------------
| > | (logior 1 (- (random 2)))
| > +---------------
| > 
| > Shorter by one token [even more if you count the parens]:
| >     (expt -1 (random 2))
| 
| Damn!  I knew there had to be a better way.
| I doff my hat to you, sir.  :-)
+---------------

Sadly, I must decline the praise, since had I but taken the trouble
to look through the entire thread before responding I would have
seen that the very same version had been proposed by Paul Griffioen
more than an hour earlier! (Oh, the shame...)  ;-}


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607