News for hackers. Stuff that matters.
Re:On being startled by a programming language by dfan on Thursday March 17, 2011 @03:29PM (#2337637)
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.
Re:On being startled by a programming language by sofuture on Thursday March 17, 2011 @04:19PM (#2337872)
True, 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.)