Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Two DO questions
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Erik Naggum  
View profile  
 More options Jan 3 2003, 6:23 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 03 Jan 2003 23:23:28 +0000
Local: Fri, Jan 3 2003 6:23 pm
Subject: Re: Two DO questions
* 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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.