From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: defconst in life.el Date: 14 Nov 2004 17:32:44 -0500 Message-ID: References: <200411141840.iAEIeXG24252@raven.dms.auburn.edu> <87k6so2ljb.fsf-monnier+emacs@gnu.org> <200411142139.iAELd9q27391@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1100471602 20239 80.91.229.6 (14 Nov 2004 22:33:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 14 Nov 2004 22:33:22 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 14 23:33:09 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CTSvl-0002zz-00 for ; Sun, 14 Nov 2004 23:33:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTT4Q-0003Im-H7 for ged-emacs-devel@m.gmane.org; Sun, 14 Nov 2004 17:42:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CTT4I-0003Id-Lt for emacs-devel@gnu.org; Sun, 14 Nov 2004 17:41:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CTT4I-0003IR-9P for emacs-devel@gnu.org; Sun, 14 Nov 2004 17:41:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTT4I-0003IO-10 for emacs-devel@gnu.org; Sun, 14 Nov 2004 17:41:58 -0500 Original-Received: from [207.245.121.140] (helo=colo.agora-net.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CTSvM-0006jf-Cl for emacs-devel@gnu.org; Sun, 14 Nov 2004 17:32:44 -0500 Original-Received: from ttn by colo.agora-net.com with local (Exim 4.41) id 1CTSvM-000316-63 for emacs-devel@gnu.org; Sun, 14 Nov 2004 17:32:44 -0500 Original-To: emacs-devel@gnu.org In-Reply-To: Luc Teirlinck's message of "Sun, 14 Nov 2004 15:39:09 -0600 (CST)" Original-Lines: 23 X-Mailer: Gnus v5.7/Emacs 20.7 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29839 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29839 Luc Teirlinck writes: Maybe somebody who uses life.el could give a more definitive answer. the docstring gives a hint: "some". this var is meant to be used experimentally (value modified, augmented, etc), so defvar is more suitable than defconst. e.g.: (defun random-life () (interactive) (let* ((w (+ 10 (random (- (frame-width) 10)))) (h (+ 5 (random (- (frame-height) 5)))) ;; a pleasant propensity to delightful density (n (random (round (/ (* w h) 2)))) (r (mapcar (lambda (x) (make-string w 32)) (number-sequence 1 h)))) (while (< 0 n) (aset (nth (random h) r) (random w) ?@) (setq n (1- n))) (let ((life-patterns (vector r))) (life 0)))) thi