On 21 Nov 2016, at 13:55, <to...@tuxteam.de> <to...@tuxteam.de> 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