unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: tomas@tuxteam.de
To: Daniel Llorens <daniel.llorens@bluewin.ch>
Cc: guile-user@gnu.org
Subject: Re: name an array function
Date: Wed, 23 Nov 2016 21:32:33 +0100	[thread overview]
Message-ID: <20161123203233.GA11850@tuxteam.de> (raw)
In-Reply-To: <F41AF455-D1B8-4D68-930B-E325B9031464@bluewin.ch>

-----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-----



  reply	other threads:[~2016-11-23 20:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 10:32 name an array function Daniel Llorens
2016-11-21 12:37 ` Stefan Israelsson Tampe
2016-11-21 12:55 ` tomas
2016-11-21 13:10   ` Daniel Llorens
2016-11-21 13:24     ` tomas
2016-11-21 13:42       ` Daniel Llorens
2016-11-21 13:56         ` tomas
2016-11-23 16:07           ` Daniel Llorens
2016-11-23 20:32             ` tomas [this message]
2016-11-23 20:48             ` David Pirotte
2016-12-15 11:12               ` Daniel Llorens
2016-12-15 11:30                 ` tomas
2016-11-21 14:01 ` Panicz Maciej Godek
2016-11-21 14:38   ` Daniel Llorens

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/guile/

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

  git send-email \
    --in-reply-to=20161123203233.GA11850@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=daniel.llorens@bluewin.ch \
    --cc=guile-user@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.
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).