Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connectionsPath: ...!feeds.phibee-telecom.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "B. Pym"
Newsgroups: comp.lang.lisp,comp.lang.scheme
Subject: Re: applying macros
Date: Thu, 19 Sep 2024 07:32:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID:
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Thu, 19 Sep 2024 09:32:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="771b02138d80f549ec3d77beeedbe017";
logging-data="527549"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eJveb9vhutBzHRQsT9Bfj"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:sQKWC2jcqEAf6j8LTcpLB0ocSfw=
Bytes: 1273
Rainer Joswig wrote:
> (defun average-function (list)
> (assert list (list)
> "List should not be empty.")
> (loop for i from 0
> for item in list
> sum item into result
> finally (return (/ result i))))
It's shorter in Gauche Scheme.
(define (average-function lst)
(let1 n 0
(/ (fold (lambda (x sum) (inc! n) (+ x sum)) 0 lst)
n)))