841 karma · joined Jun 27, 2008 (18y ago) · 727 submissions
comment 17y ago · link · parent
builder = function(x){ return function(n){ return x(x)(n); }}
factorial = function(f){ return function(n){ return n==0?1:n*f(f)(n-1);} }
alert(builder(factorial)(8))
One liner, just seed factorial to builder: r = (function(x){ return function(n){ return x(x)(n); } } (function(f){ return function(n){ return n==0?1:n*f(f)(n-1);} }))(8);comment 17y ago · link · parent
Brendan Eich did, JSON is Javascript, part of it, its own data structure, it is javascript object notation.
What Crockford did was to spread its adoption among other languages, building libraries and encouraging people to use them.
To Caesar what is Caesar’s...
comment 17y ago · link · parent
Now, say I fork lisp and change one little thing:
(defun foo (n) (lambda (i) (incf n i)))
to this:
[defun foo [n] [lambda [i] [incf n i]]]
or even this:
{defun foo {n} {lambda {i} {incf n i}}}
or how about this?
<defun foo <n> <lambda <i> <incf n i>>>
Hmm, trees are powerful, no matter how they are expressed huh?
What if we can represent the same trees using colons and commas as delimiters?
:defun foo:n, :lambda:i, :incf n i.
Maybe spice it up a bit using periods as recursive closing delimiter.
See? still powerful trees!
Between common lisp and colon lisp, I still use the latter.
Love is blindness.
comment 17y ago · link · parent
def foo(n): lambda i: n += i
Give me two powerful languages with the same features and I'll pick the latter for its syntax.
So no, lisp may be the best right now, but it won't be the best forever, its syntax is its best friend and worst enemy.
Something lispers will never understand. Love is blindness.
comment 17y ago · link · parent
"0 based for spatial coordinates, 1 based for lists and character positions."
Sums up my thoughts pretty well.
The real reason we do zero-based counting in computers is because of bits, speed and laziness.