From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.lisp.guile.user Subject: Re: name an array function Date: Mon, 21 Nov 2016 13:55:56 +0100 Message-ID: <20161121125556.GA12982@tuxteam.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1479732997 22627 195.159.176.226 (21 Nov 2016 12:56:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 21 Nov 2016 12:56:37 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: guile-user@gnu.org To: Daniel Llorens Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 21 13:56:33 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8o99-0004Y1-Lt for guile-user@m.gmane.org; Mon, 21 Nov 2016 13:56:31 +0100 Original-Received: from localhost ([::1]:49103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8o9C-0005Kc-TD for guile-user@m.gmane.org; Mon, 21 Nov 2016 07:56:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8o8q-0005KT-6a for guile-user@gnu.org; Mon, 21 Nov 2016 07:56:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8o8l-0004KP-CZ for guile-user@gnu.org; Mon, 21 Nov 2016 07:56:12 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:56164 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c8o8l-0004GH-5p for guile-user@gnu.org; Mon, 21 Nov 2016 07:56:07 -0500 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1c8o8a-0003cw-7i; Mon, 21 Nov 2016 13:55:56 +0100 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12996 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Nov 21, 2016 at 11:32:28AM +0100, Daniel Llorens wrote: > > Hello, > > version 2.2 of Guile will (I hope) include rank-polymorphic versions > of array-ref, array-set! and array-for-each. What this means is that > instead of requiring as many indices as the rank of the array, with > these functions you can give fewer indices and get a subarray (a > ‘prefix slice’). If you give all the indices, they behave just as > the current versions. Yay! (the really exciting part is in the PSen). > My original intention was for these functions to replace array-ref > and array-set!. That's how a number of array languages/libraries do > it (numpy, to mention a popular one. You don't need to say A[i, :, :], > you can just say A[i].). However, the maintainers spoke against this, > so these functions need different names. Understandable... but a pity, really. [J...] Uh, oh. That's NSFW material ;-) My head exploded (faint memories of APL). > civodul has proposed array-slice instead of array-from. However, > array-from only returns a slice when the rank of the result would > be positive. wingo has pointed out that it is unusual to have a > function name ending in a preposition. > > What do *you* think should be the names of these functions? I do like slice. But I'm perhaps off because I don't quite understand your mumblings about "the rank of the result would be positive". What do they return otherwise? Do they throw an exception? thanks - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlgy7twACgkQBcgs9XrR2kZ/9wCbBS0lNcujS1Z9YHZt55TRe5fm RlQAmwZ7mNBfIH28JCCocEO/FXkT1VH8 =9Mxq -----END PGP SIGNATURE-----