- LISP Tutorial
- LISP - Home
- LISP - Overview
- LISP - Environment
- LISP - Program Structure
- LISP - Basic Syntax
- LISP - Data Types
- LISP - Macros
- LISP - Variables
- LISP - Constants
- LISP - Operators
- LISP - Decisions
- LISP - Loops
- LISP - Functions
- LISP - Predicates
- LISP - Numbers
- LISP - Characters
- LISP - Arrays
- LISP - Strings
- LISP - Sequences
- LISP - Lists
- LISP - Symbols
- LISP - Vectors
- LISP - Set
- LISP - Tree
- LISP - Hash Table
- LISP - Input & Output
- LISP - File I/O
- LISP - Structures
- LISP - Packages
- LISP - Error Handling
- LISP - CLOS
- LISP Useful Resources
- Lisp - Quick Guide
- Lisp - Useful Resources
- Lisp - Discussion
LISP - Dotimes Construct
The dotimes construct allows looping for some fixed number of iterations.
For example, Create a new source code file named main.lisp and type the following code in it −
(dotimes (n 11) (print n) (prin1 (* n n)) )
When you click the Execute button, or type Ctrl+E, LISP executes it immediately and the result returned is −
0 0 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100
lisp_loops.htm
Advertisements