Better HN
topnewbestaskshowjobs
Log inSign up

TweedHeads

841 karma · joined Jun 27, 2008 (18y ago) · 727 submissions

spamback-at-rocketmail-dot-com
Submissions

comment 17y ago · link · parent

Full anonimity, thanks to tilly (separated for better understanding):

  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

Javascript can do it all:

  function fac(x){ return x==0?1:x*fac(x-1); }
  a = fac(8);

  or a one-liner:

  a = (function fac(x){ return x==0?1:x*fac(x-1); })(8);
Both ways spit 4320

comment 17y ago · link · parent

"Its first netbook, the Nokia Booklet 3G, will use Microsoft’s Windows software and Intel’s Atom processor"

There, doomed.

If you don't extend your arms to the open source community, don't expect us to open our arms when you need us.

Fuck you Nokia.

comment 17y ago · link · parent

"An influence was Rebol, a shame it’s not more popular"

Then the title is misleading. Rebol as an influence to what?

We should ask that question to Brendan to see what influenced HIM to design javascript as he did.

comment 17y ago · link · parent

Crockford should stop claiming he invented JSON.

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

Taking a closer look at my macbook keyboard, of all the lisp forks, I'd go with squared brackets [lisp] for convenience.

Ergonomics win.

comment 17y ago · link · parent

Dear Paul, when I say its syntax is its best friend, that's exactly what I'm talking about.

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

(defun foo (n) (lambda (i) (incf n i)))

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

In the same snarky tone, I'd say it helps to easily identify masochists in a herd of brilliant programmers.

comment 17y ago · link · parent

"how many fingers do I have? 5 - 1 = 4. Oops."

Upper-Lower+1, easy. Whenever the lower is 1, just the upper is enough.

In your case you go from 0 to 4, how's that different from how many fingers you have? 4-0=4 Oops.

comment 17y ago · link · parent

Don't try your cheap tricks on me.

We go from 1 to 5, so the math would be 5-1 +1

You go from 0 to 4, the math would be the same, 4-0 +1

Using 5 as your upper bound, then starting from 0 to 4 is the same as me using 6 as my upper bound then going from 1 to 5.

comment 17y ago · link · parent

"I am starting to think Dijkstra is about the worst thing ever happening to software development."

"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.

12345
25