Changeset 3592


Ignore:
Timestamp:
09/07/03 01:31:36 (19 years ago)
Author:
piso
Message:

DOTIMES

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/boot.lisp

    r3528 r3592  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: boot.lisp,v 1.101 2003-08-26 14:39:34 piso Exp $
     4;;; $Id: boot.lisp,v 1.102 2003-09-07 01:31:36 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    319319
    320320
     321;;; DOTIMES (from CMUCL)
     322(defmacro dotimes ((var count &optional (result nil)) &body body)
     323  (cond ((numberp count)
     324         `(do ((,var 0 (1+ ,var)))
     325              ((>= ,var ,count) ,result)
     326            ,@body))
     327        (t (let ((v1 (gensym)))
     328             `(do ((,var 0 (1+ ,var)) (,v1 ,count))
     329                  ((>= ,var ,v1) ,result)
     330                ,@body)))))
     331
     332
    321333;;; DOLIST (from CMUCL)
    322334
Note: See TracChangeset for help on using the changeset viewer.