[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) |
-----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-----
- name an array function, Daniel Llorens, 2016/11/21
- Re: name an array function, Stefan Israelsson Tampe, 2016/11/21
- Re: name an array function,
tomas <=
- Re: name an array function, Daniel Llorens, 2016/11/21
- Re: name an array function, tomas, 2016/11/21
- Re: name an array function, Daniel Llorens, 2016/11/21
- Re: name an array function, tomas, 2016/11/21
- Re: name an array function, Daniel Llorens, 2016/11/23
- Re: name an array function, tomas, 2016/11/23
- Re: name an array function, David Pirotte, 2016/11/23
Re: name an array function, Panicz Maciej Godek, 2016/11/21