Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The Little Javascripter

Name: Anonymous 2011-09-09 22:04

JavaScript has much in common with Scheme. It is a dynamic language. It has a flexible datatype (arrays) that can easily simulate s-expressions. And most importantly, functions are lambdas.

Because of this deep similarity, all of the functions in The Little Schemer can be written in JavaScript. The syntaxes of these two languages are very different, so some transformation rules are needed.



(define foo (lambda (a b c) (body)))  |  var foo = function (a, b, c) { return body; };

(foo a b c)  |  foo(a, b, c);

(and p1 p2 ... pn)  |  (p1 && p2 ... && pn)

(quote (a b c))  |  ['a', ['b', ['c']]]

foo?  |  isFoo

Name: Anonymous 2011-09-10 9:05

>>4
I don't know if you're trolling (you probably are), but JavaScript is among the fastest dynamic languages you can use.

I wish Perl or Python would come even close. But they don't. Not even the same order of magnitude, really.

There's no intrinsic reason for this, it's just a matter of how good the implementation is.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List