From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.lisp.guile.user Subject: Re: name an array function Date: Wed, 23 Nov 2016 21:32:33 +0100 Message-ID: <20161123203233.GA11850@tuxteam.de> References: <20161121125556.GA12982@tuxteam.de> <89CFAA9E-77F7-4428-AA59-72F9AB8796D7@bluewin.ch> <20161121132405.GA14580@tuxteam.de> <464A9A58-83D3-4C53-A936-BC2C83BC402C@bluewin.ch> <20161121135609.GA15712@tuxteam.de> 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 1479933193 22787 195.159.176.226 (23 Nov 2016 20:33:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2016 20:33:13 +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 Wed Nov 23 21:33:10 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 1c9eE7-0004kF-EF for guile-user@m.gmane.org; Wed, 23 Nov 2016 21:33:07 +0100 Original-Received: from localhost ([::1]:36291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9eEA-0003O2-R3 for guile-user@m.gmane.org; Wed, 23 Nov 2016 15:33:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9eDn-0003Ne-0h for guile-user@gnu.org; Wed, 23 Nov 2016 15:32:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9eDi-0007V3-5a for guile-user@gnu.org; Wed, 23 Nov 2016 15:32:47 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:34799 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 1c9eDi-0007JG-01 for guile-user@gnu.org; Wed, 23 Nov 2016 15:32:42 -0500 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1c9eDZ-00039l-Kl; Wed, 23 Nov 2016 21:32:33 +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:13005 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, Nov 23, 2016 at 05:07:30PM +0100, Daniel Llorens wrote: > > On 21 Nov 2016, at 14:56, tomas@tuxteam.de wrote: > > > I (politely) disagree: the most "commonly" used function is > > already array-ref, so you would seldomly use array-from/slice > > for a scalar result (the rank-0 result will be more frequent, > > because there's no substitute). But hey, as I said. > > I don't use array-ref/set! anymore since array-from/amend! generalize them. I actually use a further generalization in a separate library :p > > But I have a proposal below that makes this discussion moot, I hope. > > | master (current) | meaning | proposal | > |---------------------+----------------------------------+----------------------| > | array-from* | look up subarray, even #0(x) | array-slice | > | array-from | look up cell, so x and not #0(x) | array-cell-ref | > | array-amend! | set cell | array-cell-set! | > | array-for-each-cell | iterate over subarrays | array-for-each-slice | > > We define a k-cell to be a (prefix) k-subarray except that the 0-cells are x instead of #0(x). This is also consistent with the APL/J terminology (there are no rank 0 arrays in APL/J that are different from a simple element). > > (array-for-each-cell) however must iterate over k-subarrays (not k-cells) so that they can be used as write targets. Then it makes sense to change this name to (array-for-each-slice), and all the names are consistent. > > What do you think? This looks awesome to me. Very readable! thanks - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEUEARECAAYFAlg1/OEACgkQBcgs9XrR2ka1IwCdEpdCEQ+o8brVsFSWEXyR5bLY EkkAmK0Q59yIYdnAOC3ciOW9++AsjsE= =5dGO -----END PGP SIGNATURE-----