3 ms·
I'm trying to figure out what is so startling about this, actually. The { function just seems to return the element at the given index, or if you pass in a coll
by dfan 16y ago
I'm trying to figure out what is so startling about this, actually. The { function just seems to return the element at the given index, or if you pass in a collection of indices, maps that operation onto the collection. That is convenient operator overloading but not mind-blowing.
- sofuture 16y agoTrue, that is what's happening. The cool thing is that dimensional (in J terms, it's 'rank') overloading is inherent to the language. Most operators have implicit dimensional looping or respond different to differently ranked inputs. Take for example integers (i.): i.3 0 1 2 i.3 3 0 1 2 3 4 5 6 7 8 (That's kind of a dumb example, but I think it at least hints at the expressive power of rank.)