From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: swflint@flintfam.org (Samuel W. Flint) Newsgroups: gmane.emacs.devel Subject: Re: Rationalising c[ad]\{2,5\}r. Date: Wed, 11 Mar 2015 20:35:12 -0500 Message-ID: <87385bngkv.fsf@turing.flintfam.org> References: <20150311214324.GA2952@acm.fritz.box> <87zj7jb2p2.fsf@zigzag.favinet> <20150311230054.GB2952@acm.fritz.box> <87sidbayzj.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1426124150 2287 80.91.229.3 (12 Mar 2015 01:35:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Mar 2015 01:35:50 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 12 02:35:39 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YVs2F-0005QY-BK for ged-emacs-devel@m.gmane.org; Thu, 12 Mar 2015 02:35:39 +0100 Original-Received: from localhost ([::1]:57660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVs2E-0007fg-Gy for ged-emacs-devel@m.gmane.org; Wed, 11 Mar 2015 21:35:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVs29-0007fb-Il for emacs-devel@gnu.org; Wed, 11 Mar 2015 21:35:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVs23-0001eK-8D for emacs-devel@gnu.org; Wed, 11 Mar 2015 21:35:33 -0400 Original-Received: from flintfam.org ([50.116.25.174]:38372 helo=mail.flintfam.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVs23-0001do-27 for emacs-devel@gnu.org; Wed, 11 Mar 2015 21:35:27 -0400 Original-Received: from turing.flintfam.org.flintfam.org (ip174-71-117-143.om.om.cox.net [174.71.117.143]) (Authenticated sender: swflint@flintfam.org) by mail.flintfam.org (Postfix) with ESMTPSA id C9A198469 for ; Thu, 12 Mar 2015 01:35:26 +0000 (UTC) In-Reply-To: <87sidbayzj.fsf@zigzag.favinet> (Thien-Thi Nguyen's message of "Thu, 12 Mar 2015 00:36:00 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 50.116.25.174 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183797 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thien-Thi Nguyen writes: > I first heard of =E2=80=98iota=E2=80=99 in Scheme: > > (iota 8) =3D> (0 1 2 3 4 5 6 7) > > which was inspired by APL (i believe): > > https://en.wikipedia.org/wiki/APL_(programming_language) > > although the APL =E2=80=98iota=E2=80=99 (written "=CE=B9" (U+03b9)) produ= ces > a 1-based sequence instead of 0-based. I wonder what the > Common Lisp idiom for this functionality would be... (defun =CE=B9 (n) (loop for i from 0 to n collecting i)) At least that's what I've always seen. I guess you could to something like the following if you don't want to use LOOP: (defun =CE=B9 (n) (let ((list '())) (do ((i 0 (1+ i))) ((=3D i n) t) (push i list)) (reverse list))) Sam =2D- Samuel W. Flint swflint@flintfam.org (402) 517-8468 freenode: swflint http://flintfam.org/~swflint 4096R/266596F4 (9477 D23E 389E 40C5 2F10 DE19 68E5 318E 2665 96F4) "The most dangerous phrase in the language is, 'We've always done it this way'." -- Grace Hopper --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVAO1QAAoJEGjlMY4mZZb0FEYQAIhdq4R2yaJXRWpve9D2W+QW zRkjY86uN0jJux3bwgfptDsgJfmPyHT02ZLN4VZr/ManRTujS3n0eBD8Ti8r9usG /Sl//ujy7qv2ekY0SwtSkcPOrkaiP8DQdg95kb6iveAdTBUVdVV99oySLEDqSUHR Nou4gK0Giccz6Yb7iu1w1XE7C1z1SVwHSSCchTOW9qg80+YH6oMKto8AkSDtXSKY /Wb9PoQilbTz07E+Wn4pCE9ji74JLbJs4exHMb9T6SUN9ZZUPort3BXPDAuMZ19B cb5jLv9bPskYc6wwGaQ+09ojpOWux0Vm+pc+3noEbLwcwfxKzsJaWwQIT10RfLKo f9+y/y8JUapi+QSN51x7at3v462gQLzec352m0V+LGIj7NjiDWFEVJ6YxDmXw9LN 67WdCqtuOf1OCIuFtDPka5wUDHwqBA6pq3i3K5MXR92sXgwow39J4CaR5HXoR888 QfGo4ac/2wqA0ipZMnSgmCNw2mjipu9ffiDbmX6+qTbI7XvOv/jgXsq05BeQw01N AF7po516NwY+FTODuIgDggRWQqk568Z7yQnU8GmcAeDMOtpm9Zn6+8gBGoeYjbev QY5p7IECQboc+BX/0QExT1TnJcP3KZsw9/eLjFV1YoB8y3H84JsktNbXPLIEvkyc oRbi8PVQUSwtS41CXPvw =MlMx -----END PGP SIGNATURE----- --=-=-=--