unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: Daniel Llorens <daniel.llorens@bluewin.ch>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: name an array function
Date: Mon, 21 Nov 2016 13:37:35 +0100	[thread overview]
Message-ID: <CAGua6m3Kwg5Y9Vf74T5ut2TULjyzQ+7JHD1jaGCRso440v2CGA@mail.gmail.com> (raw)
In-Reply-To: <DA445D66-DFBB-48D4-B9C5-AB5D85005EF9@bluewin.ch>

array-sub maybe,

On Mon, Nov 21, 2016 at 11:32 AM, Daniel Llorens <daniel.llorens@bluewin.ch>
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.
>
> 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.
>
> The names I chose are array-from, array-amend! and array-for-each-cell.
> These names are taken from the J docs (http://www.jsoftware.com/
> help/dictionary/d520.htm, http://www.jsoftware.com/help/
> dictionary/d530n.htm), because the behavior is based on J and I consider
> J to be ‘the source’ when it comes to these concepts.
>
> 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?
>
> Thanks,
>
>         lloda
>
> PS: The justification for these functions is given in the documentation,
> but in short: 1) other than the creation of the subarray descriptors, they
> don't cost any more than the rank-strict versions, 2) the only way to
> reproduce them in current Guile is with make-shared-array, which is very
> slow and cumbersome, 3) they recover a functionality that used to be part
> of Guile but was removed (‘enclosed arrays’).
>
> PPS: You can check out the functions at http://git.savannah.gnu.org/
> gitweb/?p=guile.git;a=shortlog;h=refs/heads/lloda-squash1. I rebase this
> branch on master periodically. The maintainers have reviewed it, but any
> extra reviews would of course be appreciated, especially of the doc.
>
>
>


  reply	other threads:[~2016-11-21 12:37 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 [this message]
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
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=CAGua6m3Kwg5Y9Vf74T5ut2TULjyzQ+7JHD1jaGCRso440v2CGA@mail.gmail.com \
    --to=stefan.itampe@gmail.com \
    --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).