Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!bu-cs!bzs From: bzs@bu-cs.UUCP (Barry Shein) Newsgroups: net.ai,net.lang.lisp Subject: Re: Common LISP style standards. Message-ID: <717@bu-cs.UUCP> Date: Sun, 1-Jun-86 13:03:30 EDT Article-I.D.: bu-cs.717 Posted: Sun Jun 1 13:03:30 1986 Date-Received: Tue, 3-Jun-86 22:30:54 EDT Organization: Boston Univ Comp. Sci. Lines: 27 Xref: linus net.ai:3264 net.lang.lisp:764 [re: Franz Lisp] >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 Howsabout: (defun foo (x) (prog nil (mapc '(lambda (y) (cond ((null y) (return 'DONE)) (t (print y)))) x))) try for example (foo '(a b nil c d)) -Barry Shein, Boston University