IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: Yabut...
The APL idiom is pretty simple, despite appearences - the -64 and 65 are for creating an "index vector" 1 2 3...n starting at A and ending at whatever letter represented by n - taken from the "atomic vector" []av which is a system variable representing the collating sequence. Once you simplify that it's just

@@(i"0 (-1+i SEQ i 'DATA'))@SEQ

where SEQ is the subset "@A...Z" of the atomic vector.

So this idiom

1) Creates an array with a number of rows = the number of letters in DATA, where each row is 1 2 3...L(n), L(n) being the nth letter in DATA.

2) Indexes that array into SEQ to produce the corresponding array of letters

3) "Unrolls" this enclosed array twice to produce the various permutations. The selection operator "from" is thus used three times, once dyadically and twice monadically. The indexing operator "index" (i) is also used once dyadically and twice monadically (not an accident, the operators are complementary). The "rank" operator allows the "index" operator to go inside the argument array by explicitly modifying the expected strucutre of the argument - this is a very powerful APL feature that is like a "view" on an array, that is, "for this case, this isn't an MxN matrix of scalars, it's M vectors of length N", etc. etc.

This is how APL programming works - one writes statements that exhibit algorithms.


-drl
New Appearances *are* complexity
Your description only makes it simpler if one understands the terms "index vector", "atomic vector", "collating sequence", "array" as a verb, "unrolls", "dyadically" and "monadically", and "operator".

;)
"There's a set of rules that anything that was in the world when you were born is normal and natural. Anything invented between when you were 15 and 35 is new and revolutionary and exciting, and you'll probably get a career in it. Anything invented after you're 35 is against the natural order of things."

Douglas Adams
     Combinatron - (tablizer) - (39)
         Python example (using generators) - (admin) - (3)
             Nice language - reads as easy as pseudocode - (deSitter) - (2)
                 Post the code. -NT - (admin) - (1)
                     The idiom - (deSitter)
         OK, so the generators were nifty, but not needed :-) - (admin) - (34)
             Probably more efficient: - (admin) - (33)
                 And the readable version :P - (FuManChu) - (32)
                     Ick. Globals. - (admin) - (31)
                         Granted. - (FuManChu) - (30)
                             Like this? - (admin) - (29)
                                 This is probably worth decomposing, too - (admin)
                                 Now you've EARNED my nasty Perl tricks... - (ben_tilly) - (25)
                                     Yabut... - (admin) - (20)
                                         Re: Yabut... - (deSitter) - (1)
                                             Appearances *are* complexity - (FuManChu)
                                         They can? - (ben_tilly) - (17)
                                             Ruby? (Perl was impressive, knock me out dude) -NT - (deSitter) - (15)
                                                 Sorry, I am rusty enough not to attempt it - (ben_tilly)
                                                 Two Ruby Versions - (JimWeirich) - (13)
                                                     Recursive + stack space... - (admin) - (10)
                                                         Re: Recursive + stack space... - (JimWeirich) - (7)
                                                             Ah, ok. - (admin) - (6)
                                                                 Proof by induction - (deSitter) - (5)
                                                                     ... - (admin) - (4)
                                                                         (sheepish grimace) - (deSitter)
                                                                         Recursion and Lisp - (JimWeirich) - (2)
                                                                             You still misunderstand me. - (admin) - (1)
                                                                                 Re: You still misunderstand me. - (deSitter)
                                                         Only other people's... :) - (FuManChu) - (1)
                                                             No, I should go look that one up. -NT - (admin)
                                                     Let me golf the one-liner a little... - (ben_tilly) - (1)
                                                         Ooo ... Good call on split - (JimWeirich)
                                             Wrong interpretation. - (admin)
                                     Please deconstruct it for me - (broomberg) - (3)
                                         Deconstructed - (ben_tilly) - (2)
                                             Ahh - (broomberg) - (1)
                                                 Ditto, but I remember the stupid trick for golf -NT - (ben_tilly)
                                 Mein Gott. - (FuManChu) - (1)
                                     Yep. It's a great language. -NT - (admin)

Ignore the man talking to his hand.
159 ms