Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!husc6!harvard!seismo!rochester!bullwinkle!uw-beaver!ssc-vax!bcsaic!michaelm From: michaelm@bcsaic.UUCP (michael maxwell) Newsgroups: net.ai,net.lang.lisp Subject: Re: Common LISP style standards. Message-ID: <545@bcsaic.UUCP> Date: Thu, 15-May-86 13:42:18 EDT Article-I.D.: bcsaic.545 Posted: Thu May 15 13:42:18 1986 Date-Received: Fri, 30-May-86 09:18:52 EDT References: <2784@jhunix.UUCP> <3787@utah-cs.UUCP> Reply-To: michaelm@bcsaic.UUCP (michael maxwell) Distribution: net Organization: Boeing Computer Services AI Center, Seattle Lines: 25 Xref: watmath net.ai:3547 net.lang.lisp:853 In article <3787@utah-cs.UUCP> shebs@utah-cs.UUCP (Stanley Shebs) writes: >Sequence functions and mapping functions are generally preferable to >handwritten loops, since the Lisp wizards will probably have spent >a lot of time making them both efficient and correct (watch out though; >quality varies from implementation to implementation). I'm in a little different boat, since we're using Franz rather than Common Lisp, so perhaps the issues are a bit different when you're using Monster, I mean Common, Lisp... so at the risk of rushing in where angels etc.: A common situation we find ourselves in is the following. We have a long list, and we wish to apply some test to each member of the list. However, at some point in the list, if the test returns a certain value, there is no need to look further: we can jump out of processing the list right there, and thus save time. Now you can jump out of a do loop with "(return )", but you can't jump out of a mapc (mapcar etc.) with "return." So we wind up using "do" a lot of places where it would otherwise be natural to use "mapcar". I suppose I could use "catch" and "throw", but that looks so much like "goto" that I feel sinful if I use that solution... Any style suggestions? -- Mike Maxwell Boeing Artificial Intelligence Center ...uw-beaver!uw-june!bcsaic!michaelm