In Python syntax:
def add(a, b):
return add_r(a, b, 0)
def add_r(a, b, c):
if b == c:
return a
else:
return add_r(a, b, c+1) +121–30 of 185 posts
In Python syntax:
def add(a, b):
return add_r(a, b, 0)
def add_r(a, b, c):
if b == c:
return a
else:
return add_r(a, b, c+1) +1You say addition is O(n^2), but I think you can write an O(n) addition with only increment, recursion, and equality testing. In Python syntax: def add(a, b): return add_r(a, b, 0) def add_r(a, b, c): if b == c: return a else: return add_r(a, b, c+1) +1
Earlier quoted context omitted.
Lame qn but does the name Albert Jay Nock have anything to do with 'Nock'?
http://en.wikipedia.org/wiki/Albert_Jay_Nock http://en.wikipedia.org/wiki/Tea_at_the_Palaz_of_Hoon Four-letter names that haven't been overexposed are hard to find. But four letters fits in a 32-bit direct atom, so the attraction is pretty irresistible.
You say addition is O(n^2), but I think you can write an O(n) addition with only increment, recursion, and equality testing. In Python syntax: def add(a, b): return add_r(a, b, 0) def add_r(a, b, c): if b == c: return a else: return add_r(a, b, c+1) +1
This is really, really neat. I really like the concepts in Avro and Urbit. Particularly interesting for me is the checkpoint/replay, distributed version control, and neighbours. This is a really cool experiment!
Thanks, but Avro is someone else's cool project! (Arvo is named for http://en.wikipedia.org/wiki/Arvo_P%C3%A4rt. )
"There is never a reason to program in Nock. Except to learn Nock." Classic
You say addition is O(n^2), but I think you can write an O(n) addition with only increment, recursion, and equality testing. In Python syntax: def add(a, b): return add_r(a, b, 0) def add_r(a, b, c): if b == c: return a else: return add_r(a, b, c+1) +1
So rather than having a lengthy standard it has lots of small non-standardized and brittle performance optimizations? I remain skeptical over whether this tradeoff is worth it.
Earlier quoted context omitted.
I'm not sure I follow what this is. Where would I use Nock and Hoon?
To build your startup? No. To have fun? Why not.
By way of example, the K&R C book had a beautiful clarity and ability to fluidly move between the realms of reference, spec, and tutorial. If you're going to hold K&R C up as a model, you'd do well to mimic its documentation philosophy.