5 ms·
The Little Javascripter
- tumult 17y agoPLT Scheme is so easy to download and get started with. I really recommend you use that instead of JavaScript when working through The Little Schemer. http://www.plt-scheme.org/ http://www.plt-scheme.org/ I'm working out a problem right now for JavaScript (client-side dictionary/grammar thingy) and it's easier for me to explore the problem in Scheme. I don't really know why anyone would voluntarily choose to use JavaScript when Scheme is available. edit: I'm not hating on this idea. JavaScript DOES have first-class functions and lexical scoping, so you can indeed do The Little Schemer in it. I'm pointing out PLT Scheme for anyone who hasn't already done The Little Schemer and has had their interest piqued.
- boucher 17y agoThere are some people who prefer JavaScript to scheme. More importantly, many more people have been exposed to JavaScript than have been exposed to scheme.
- tumult 17y agoTotally. And I hope to expose these people to Scheme :) That way, when your actual job calls for working on stuff in JavaScript (like me!), you have another perspective in your toolkit.
- swannodette 17y agoThose who know anything about JavaScript know that JavaScript WAS Scheme (plus Self). And then Brendan Eich was forced to adopt C style syntax because of the impending popularity of Java.
- NathanKP 17y agoNow I know where the term Y Combinator came from. Am I the only ignorant one here who had never heard of "The Applicative Order Y Combinator"? JavaScript: function Y(le) { return (function (f) { return f(f); } (function (f) { return le(function (x) { return f(f)(x); }); })); } Trippy recursive function, but I don't think I quite understand what you would use it for. ;)
- tumult 17y agoRecursion without requiring some kind of name primitive.
- fbru02 17y agoLook at SICP lectures number 7a and 7b they are quite good at explaining this point.
- apgwoz 17y agoThe lambda calculus doesn't really have assignment, so you can't call a function recursively in the way we're used to in modern programming languages. However, Y allows us to give a recursive function a temporary name which we can then use to apply it recursively. It's trippy, for sure, but pretty much theoretical use only for most people.
- brehaut 17y agoHave a look at this little paper by Richard Gabriel http://www.dreamsongs.com/NewFiles/WhyOfY.pdf http://www.dreamsongs.com/NewFiles/WhyOfY.pdf
- deleted 17y ago[deleted]
- ams6110 17y agoHeh that takes me back to my "Programming Languages" class, taught by Friedman, and using The Little LISPer as a textbook.