From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Two DO questions Date: 03 Jan 2003 23:23:28 +0000 Organization: Naggum Software, Oslo, Norway Lines: 28 Message-ID: <3250625008424209@naggum.no> References: <8d844ffa.0301030442.42663f4@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: maud.ifi.uio.no 1041636209 5794 129.240.65.207 (3 Jan 2003 23:23:29 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 3 Jan 2003 23:23:29 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:49838 * Jules Grosse | 1) How can I reproduce the following behaviour: | | (dotimes (x 10) | (dotimes (y 10) | (do-something-with x y))) | | Using only one "do" construct? How about only one "loop" construct? It does appear to be homework, so it may be instructive to look at what Common Lisp may look like and yet be maximally inadmissible. (prog (x y) 0 (setq x 0) 1 (setq y 0) 2 (do-something-with x y) 3 (cond ((< (incf y) 10) (go 2)) ((< (incf x) 10) (go 1)))) It is sometimes exceptionally useful to be able to build things from such basic building blocks, however. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.