unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: defconst in life.el
Date: Fri, 19 Nov 2004 19:52:35 +0200	[thread overview]
Message-ID: <87wtwhiv4s.fsf@jurta.org> (raw)
In-Reply-To: <jkwtwo83jn.fsf@glug.org> (Thien-Thi Nguyen's message of "14 Nov 2004 17:32:44 -0500")

Thien-Thi Nguyen <ttn@glug.org> writes:
> Luc Teirlinck <teirllm@dms.auburn.edu> 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))))

Why don't you install your fun?  Filling the matrix with random values
is one of the most amusing aspects of life.

As I see in life.el, Luc already changed the life-pattern type from
defconst to defvar so it's good to install it now.  But please rename
`random-life' to `life-random' to satisfy the package prefix.  Thanks.

-- 
Juri Linkov
http://www.jurta.org/emacs/

  parent reply	other threads:[~2004-11-19 17:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-14 18:40 defconst in life.el Luc Teirlinck
2004-11-14 21:02 ` Stefan Monnier
2004-11-14 21:39   ` Luc Teirlinck
2004-11-14 21:42     ` Luc Teirlinck
2004-11-14 22:32     ` Thien-Thi Nguyen
2004-11-14 22:51       ` Luc Teirlinck
2004-11-17  1:48         ` Kenichi Handa
2004-11-23  2:34           ` Luc Teirlinck
2004-11-19 17:52       ` Juri Linkov [this message]
2004-11-19 18:47         ` Thien-Thi Nguyen
2004-11-15 14:00 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wtwhiv4s.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).