guile-user
[Top][All Lists]
Advanced

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

Re: name an array function


From: Daniel Llorens
Subject: Re: name an array function
Date: Mon, 21 Nov 2016 14:10:12 +0100

On 21 Nov 2016, at 13:55, <address@hidden> <address@hidden> wrote:

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

yeah...

> Uh, oh. That's NSFW material ;-) My head exploded (faint memories
> of APL).

check out ‘J for C programmers’, I think it has good explanations.

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

They return the element itself. E.g.

(array-from #2((a b) (c d)) 0) => #1(a b)
(array-from #2((a b) (c d)) 0 0) => a

the rank of the second result would be zero (so #0(a)) if the result was always 
a ‘slice’. This is what I meant. There's a variant which always returns a 
‘slice’:

(array-from* #2((a b) (c d)) 0) => #1(a b)
(array-from* #2((a b) (c d)) 0 0) => #0(a)






reply via email to

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