Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Besides First Class Functions and Lexical Scoping, what does JavaScript share with Scheme implementations?

I have always wondered why Douglas Crockford keeps comparing JavaScript to Scheme. Yes JS was intended to be Scheme by its designer; but besides the first class function support and the lexical scoping (broken), what features does JS have in common with Scheme that makes it "Lisp in C's Clothing"?

like image 485
unj2 Avatar asked Mar 12 '11 13:03

unj2


People also ask

What must be done in JavaScript to implement lexical scoping?

What must be done in order to implement Lexical Scoping? Explanation: In order to implement lexical scoping, the internal state of a JavaScript function object must include not only the code of the function but also a reference to the current scope chain.

What is the lexical scope in JavaScript?

What is Lexical Scope in JavaScript? Lexical scope is the definition area of an expression. In other words, an item's lexical scope is the place in which the item got created.

What is scope and lexical scope in JavaScript?

Lexical scoping in JavaScriptJavaScript uses lexical scoping to resolve the variable names when a function is created inside another function. It determines the function's parent scope by looking at where the function was created instead of where it was invoked.

Is JavaScript based on Scheme?

They recruited Eich in 1995, because they wanted him to create a programming language for that web browser. The lure for him was that he would be able to base the language on Scheme (a Lisp dialect). Scheme's influence led to JavaScript having closures.


1 Answers

Another thing that comes to mind is the pervasive use of a single ubiquitous data structure throughout the language and the libraries: cons lists in the case of Scheme, maps (called objects) in the case of ECMAScript.

Then there is not just the fact that ECMAScript has first-class procedures, but that those procedures are the only abstraction mechanism. (Or more precisely encapsulation mechanism.)

like image 162
Jörg W Mittag Avatar answered Sep 30 '22 05:09

Jörg W Mittag