X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=utils.lisp;h=29d9a42506ffdf50fa253e658b3ceb48332d40a0;hb=4c844bde197de54c0343f7ab500153278f859ec6;hp=247722415a707252417378d1fefa378d61431a4e;hpb=48b1a775e575a66bc154620107a8e27321ea306c;p=reversi.git diff --git a/utils.lisp b/utils.lisp index 2477224..29d9a42 100644 --- a/utils.lisp +++ b/utils.lisp @@ -7,9 +7,9 @@ ;;;; Programer: Kevin M. Rosenberg ;;;; Date Started: 1 Nov 2001 ;;;; -;;;; $Id: utils.lisp,v 1.4 2003/05/06 15:51:20 kevin Exp $ +;;;; $Id$ ;;;; -;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg +;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg ;;;; ;;;; Reversi users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License @@ -18,8 +18,6 @@ (in-package #:reversi) -(eval-when (:compile-toplevel) - (declaim (optimize (safety 1) (space 0) (speed 3) (compilation-speed 0)))) (defmacro missing-argument () `(error "Missing an argument to a constructor")) @@ -44,9 +42,10 @@ Like mapcon, but uses append instead of nconc." (apply #'append (mapcar fn list))) -(defun random-elt (seq) +(defun random-nth (seq) + (declare (list seq)) "Pick a random element out of a sequence." - (elt seq (random (length seq)))) + (nth (random (length seq)) nth)) (defun concat-symbol (&rest args) "Concatenate symbols or strings to form an interned symbol"