[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: name an array function

From: tomas
Subject: Re: name an array function
Date: Mon, 21 Nov 2016 13:55:56 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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.


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?

- -- t
Version: GnuPG v1.4.12 (GNU/Linux)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]