From ... Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!npeer.kpnqwest.net!reader3.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: I like WHEN/UNLESS Was: Promoting CL Was: What I want from my Common Lisp vendor and the Common Lisp community References: <3208404998010473@naggum.net> <87itf1a2fh.fsf_-_@piracy.red-bean.com> <99fb3972.0109021504.bba92d0@posting.google.com> <3208475381413624@naggum.net> <3208511830109687@naggum.net> <87r8tow5ej.fsf@orion.bln.pmsf.de> <871ylnx1pw.fsf@orion.bln.pmsf.de> <9n33uu$rl3$0@216.39.145.192> <87lmjun4eo.fsf@nkapi.internal> <87d756wq2w.fsf@noetbook.telent.net> Mail-Copies-To: never From: Erik Naggum Message-ID: <3208727206846415@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 34 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 06 Sep 2001 01:06:50 GMT X-Complaints-To: newsmaster@Norway.EU.net X-Trace: reader3.kpnqwest.net 999738410 193.71.66.49 (Thu, 06 Sep 2001 03:06:50 MET DST) NNTP-Posting-Date: Thu, 06 Sep 2001 03:06:50 MET DST Xref: archiver1.google.com comp.lang.lisp:15710 * Thomas F. Burdick > Do you use the variation that unconditionally binds the result of the > predicate to THIS (or something similar)? That drives me nuts, > personally, so I use IF-LET: > > (if-let (damn-thang (find-the-damn-thang)) > (do-the-damn-thang damn-thang) > (do-something-else)) > > which I like much better. While binding and testing at the same time is useful, I find that I either want it to be bound first and tested independently (let ((damn-thang (find-the-damn-thang))) (if damn-thang (do-the-damn-thang damn-thang) (do-something-else))) or assigned to in the test (let ((damn-thang)) (if (setq damn-thang (find-the-damn-thang)) (do-the-damn-thang damn-thang) (do-something-else))) or using more advanced control-flow mechanisms, more suitable when there is no else branch and much more going on, such as an already established block surrounding the forms at the appropriate level (block nil (do-the-damn-thang (or (find-the-damn-thang) (return)))) ///