[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: |
Wed, 23 Nov 2016 21:32:33 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
-----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, address@hidden 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-----
- 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, 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/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 <=
- Re: name an array function, David Pirotte, 2016/11/23
Re: name an array function, Panicz Maciej Godek, 2016/11/21