Hacker News new | ask | show | jobs
by davidnc 3381 days ago
I thought I'd try writing a translation into Python. Not sure if it makes it any easier to follow, though...

http://pastebin.com/yK1HrZJQ

2 comments

Since K was specifically invoked in the article,

    c: {[h;t]{(h;t)x}}                  / cons
    h: {x 0}                            / head
    t: {x 1}                            / tail
    n: {h y t/x}                        / nth
    p: h'-1_(~^:)t\                     / print
    r: {{$[^y;x;c[h y;x]o t y]}[0N;x]}  / reverse
And it was not, by the way, invented by Ursula K Leguin. I checked.
You sir are a gentleman. Good job!