Lisp'styled JavaScript

Click here to load reader

  • date post

    18-Dec-2014
  • Category

    Technology

  • view

    1.768
  • download

    0

Embed Size (px)

description

It's about a way of coding in JavaScript in the most Functional style without any kind of sugar.Video is here:http://www.devclub.eu/2011/07/04/lisp-like-javascript/ (it's in Russian)

Transcript of Lisp'styled JavaScript

  • 1. Lispstyle code with JS Lisp by Aleksandr Motsjonov, 5 2011 .
  • 2. Lispstyle code with JS Lisp Or The Little JavaScripter by Aleksandr Motsjonov, 5 2011 .
  • 3. Lispstyle code with JS Lisp Or how to make JavaScript ugly ... by Aleksandr Motsjonov, 5 2011 .
  • 4. Scheme Lispstyle code with JS Or how to make JavaScript ugly ... by Aleksandr Motsjonov, 5 2011 .
  • 5. Douglas Crockford, 5 2011 .
  • 6. Douglas Crockford, 5 2011 .
  • 7. Douglas Crockford, 5 2011 .
  • 8. Douglas Crockford Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed., 5 2011 .
  • 9. Douglas Crockford Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed. Every time you declare a variable in the global scope, Douglas Crockford kills a kitten., 5 2011 .
  • 10. Douglas Crockford Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed. Every time you declare a variable in the global scope, Douglas Crockford kills a kitten. There is only one necessary global, and that is Douglas Crockford, 5 2011 .
  • 11. Douglas Crockford Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed. Every time you declare a variable in the global scope, Douglas Crockford kills a kitten. There is only one necessary global, and that is Douglas Crockford JohnResig == awesome, but DouglasCrockford === awesome, 5 2011 .
  • 12. Douglas Crockford Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed. Every time you declare a variable in the global scope, Douglas Crockford kills a kitten. There is only one necessary global, and that is Douglas Crockford JohnResig == awesome, but DouglasCrockford === awesome Im your father, John, 5 2011 .
  • 13. Douglas Crockford Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed. Every time you declare a variable in the global scope, Douglas Crockford kills a kitten. There is only one necessary global, and that is Douglas Crockford JohnResig == awesome, but DouglasCrockford === awesome Im your father, John In truth there exists no anonymous functions in JavaScript because Douglas Crockford loves and names all of his children., 5 2011 .
  • 14. Douglas Crockford Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed. Every time you declare a variable in the global scope, Douglas Crockford kills a JavaScript Guru! kitten. There is only one necessary global, and that is Douglas Crockford JohnResig == awesome, but DouglasCrockford === awesome Im your father, John In truth there exists no anonymous functions in JavaScript because Douglas Crockford loves and names all of his children., 5 2011 .
  • 15. , 5 2011 .
  • 16. , 5 2011 .
  • 17. ... it did a remarkable thing: It could teach you to think recursively , 5 2011 .
  • 18. ... it did a remarkable thing: It could teach you to think recursively ... all of the functions in The Little Schemer can be written in JavaScript. , 5 2011 .
  • 19. ... it did a remarkable thing: It could teach you to think recursively ... all of the functions in The Little Schemer can be written in JavaScript. So get a copy of The Little Schemer and start recursing ... , 5 2011 .
  • 20. ... it did a remarkable thing: It could teach you to think recursively ... all of the functions in The Little Schemer And so I didn...b e w r i t t e n i n ca JavaScript. So get a copy of The Little Schemer and start recursing ... , 5 2011 .
  • 21. Primitives car, cdr, cons, null?, eq?, zero?, 5 2011 .
  • 22. Primitives car, cdr, cons, isNull, eq?, zero? null?, isEq, isZero, 5 2011 .
  • 23. Primitives car, cdr, cons, isNull, eq?, zero? null?, isEq, isZero car = function(list) { isZero = function(number){ return list[0]; return number === 0; }; }; cdr = function(list) { isNull = function(list) { return list.slice(1); return list.length === 0; }; }; cons = function(atom, list) { isEq = function(o1, o2) { var tmp = utils.copy_arr(list); return o1 === o2; tmp.splice(0, 0, atom); }; return tmp; };, 5 2011 .
  • 24. Primitives car, cdr, cons, isNull, eq?, zero? null?, isEq, isZero car = function(list) { isZero = function(number){ return list[0]; return number === 0; }; }; cdr = function(list) { return list.slice(1); cond