I've read that javascript was in part based on Scheme, a dialect of LISP. When I was reading about this and LISP, it struck me that the javascript function expression syntax seemed like a similar kind of structure. My understanding of s-expressions is that all syntax is either treated as an atom, or s-expressions which can then be recursively referenced, and is eventually reduced down to an atom. If a javascript function treats the creation and reference of a function as just another variable (and arrays, strings, and numbers can all be assigned to variables too) does that mean that the javascript function expression is essentially a implementation of the s-expression idea?
S-expressions (short for symbolic expressions) are a data format (like for example XML, JSON, ...). S-expressions are built out of lists, symbols, numbers, strings and other data objects.
Lisp data and code is typically written as s-expressions in an external textual format or created by functions.
Creating a nested list:
CL-USER 1 > (list '* 10 (list '- 3 5))
(* 10 (- 3 5))
The above result is actually a nested list of symbols and numbers, not a string.
Actually executing this list as a program:
CL-USER 2 > (eval (list '* 10 (list '- 3 5)))
-20
JavaScript does not have the direct equivalent of this:
it does not write code in such data structures. JavaScript programs are text
JavaScript can evaluate source code with its eval
, but the source code is a string
JavaScript function objects are unrelated, since they are not source code themselves, have no textual format, etc.. Taking arguments and computing with them also makes them not source code and don't make them dealing with the equivalent of S-expressions. S-expressions are used in Lisp to represent source code just like other data.
I am trying to make a Python 3 application to download weather data from my account at http://www.osanywhereweather.com. I have found JavaScript source code that does exactly this at https://github....
I am trying to make a Python 3 application to download weather data from my account at http://www.osanywhereweather.com. I have found JavaScript source code that does exactly this at https://github....
I am trying to create a Partial View that is a submission form for creating a a new ProductionGoal model. It uses ProductionLineViewModel to create that. My main question is how to pass that data ...
I am trying to create a Partial View that is a submission form for creating a a new ProductionGoal model. It uses ProductionLineViewModel to create that. My main question is how to pass that data ...
My task: I have a file that contains many items and each item is related to an array of URLs of images which I need to download. I want to download all of the links, I'm using this library for the ...
My task: I have a file that contains many items and each item is related to an array of URLs of images which I need to download. I want to download all of the links, I'm using this library for the ...
How the variable 'str2' is available inside the callback method passed to display method? str2 should be visible only inside function 'name'. a = { display: function (n){ console.log("I ...
How the variable 'str2' is available inside the callback method passed to display method? str2 should be visible only inside function 'name'. a = { display: function (n){ console.log("I ...