source: trunk/cocoa-ide-contrib/krueger/InterfaceProjects/Utilities/utility.lisp @ 14585

Last change on this file since 14585 was 14585, checked in by plkrueger, 9 years ago

App Developer Tools from pkrueger

File size: 1.4 KB
Line 
1;;; utility.lisp
2
3#|
4The MIT license.
5
6Copyright (c) 2010 Paul L. Krueger
7
8Permission is hereby granted, free of charge, to any person obtaining a copy of this software
9and associated documentation files (the "Software"), to deal in the Software without restriction,
10including without limitation the rights to use, copy, modify, merge, publish, distribute,
11sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all copies or substantial
15portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23|#
24
25(defpackage :interface-utilities
26  (:nicknames :iu)
27  (:export do-sequence))
28
29(in-package :iu)
30
31(defmacro do-sequence ((seq-elt seq &optional (return t)) &rest body)
32  (let ((seq-indx (gensym)))
33    `(dotimes (,seq-indx (length ,seq) ,return)
34       (let ((,seq-elt (elt ,seq ,seq-indx)))
35         ,@body))))
Note: See TracBrowser for help on using the repository browser.