<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Languages of the real and artificial - Latest Comments in Functional JavaScript</title><link>http://osteele.disqus.com/</link><description></description><atom:link href="https://osteele.disqus.com/functional_javascript/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 27 Sep 2007 18:58:41 -0000</lastBuildDate><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881124</link><description>&lt;p&gt;This library rocks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Mercer</dc:creator><pubDate>Thu, 27 Sep 2007 18:58:41 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881123</link><description>&lt;p&gt;[...] E outro carinha criou uma biblioteca para escrever javascript funcional (map, reduce, filter), chamada “Functional Javascript” [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Javascript como SmallTalk e Ja</dc:creator><pubDate>Mon, 13 Aug 2007 12:17:48 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881122</link><description>&lt;p&gt;Thomas, you're right; thanks for the find and the fix.  I've fixed it above now.&lt;/p&gt;&lt;p&gt;I wrote the code that splices the output values into the "examples page":&lt;a href="http://osteele.com/sources/javascript/functional" rel="nofollow noopener" target="_blank" title="http://osteele.com/sources/javascript/functional"&gt;http://osteele.com/sources/...&lt;/a&gt; exactly because I knew I wouldn't successfully keep them up to date with the expressions, but I couldn't (or didn't take the time to) do the same thing on this blog page :-(&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">osteele</dc:creator><pubDate>Sat, 04 Aug 2007 14:58:21 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881120</link><description>&lt;p&gt;Just a quick fix: The example&lt;br&gt;"map(guard('10+', not('%2')), [1,2,3,4])" in your Function-level programming section should probably produce&lt;br&gt;"-&amp;gt; [1,12,3,14]", or shouldn't it?!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Herchenroeder</dc:creator><pubDate>Mon, 30 Jul 2007 07:13:25 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881119</link><description>&lt;p&gt;[...] Jul 27th, 2007 by kiterminal    à¸§à¸±à¸™à¸™à¸µà¹‰à¸šà¸±à¸‡à¹€à¸­à¸´à¸à¹„à¸›à¹€à¸ˆà¸­ Blog à¸‚à¸­à¸‡ Oliver Steele à¸‹à¸¶à¹ˆà¸‡à¹€à¸„à¹‰à¸²à¹„à¸›à¸—à¸³ Functional JavaScript à¹„à¸§à¹‰ à¸¥à¸­à¸‡à¸¡à¸²à¸”à¸¹à¸•à¸±à¸§à¸­à¸¢à¹ˆà¸²à¸‡à¸—à¸µà¹ˆà¹€à¸„à¹‰à¸²à¸—à¸³à¹ƒà¸«à¹‰à¸”à¸¹à¸¥à¸°à¸à¸±à¸™  map(function(x){return x+1}, [1,2,3]) -&amp;gt; [2,3,4] filter(function(x){return x&amp;gt;2}, [1,2,3,4]] -&amp;gt; [3,4] some(function(w){return w.length &amp;lt; 3}, ‘are there any short words?’.split(’ ‘)) -&amp;gt; false // double the items in a list: map(’*2′, [1,2,3]) -&amp;gt; [2, 4, 6] // find just the odd numbers: filter(’%2′, [1,2,3,4]) -&amp;gt; [1, 3] // or just the evens: filter(not(’%2′), [1,2,3,4]) -&amp;gt; [2, 4]  à¸—à¸±à¹‰à¸‡à¸™à¸µà¹‰à¹€à¸„à¹‰à¸²à¸¢à¸±à¸‡à¹„à¸”à¹‰à¸—à¸³ API documentation à¹„à¸§à¹‰à¹ƒà¸«à¹‰à¸­à¹ˆà¸²à¸™à¹à¸¥à¸°à¸¨à¸¶à¸à¸©à¸²à¸à¸±à¸™à¸”à¹‰à¸§à¸¢ [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Functional JavaScript « Kiterm</dc:creator><pubDate>Thu, 26 Jul 2007 22:42:21 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881118</link><description>&lt;p&gt;We had wrote such library for our product, as almost all developers was experienced Scheme developers ;-)&lt;br&gt;JavaScript code in functional looks very elegant and readable&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Ott</dc:creator><pubDate>Thu, 26 Jul 2007 09:23:51 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881117</link><description>&lt;p&gt;[...] Functional Javascript  26 07 2007   Currently i am working on Javascript and i am learning a lot.While searching for some code samples in Javascript I came across a new term Functional Javascript.We all know what is “Functions” in javascript.But what is functional javascript???Let’s see. [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Functional Javascript « Bloomi</dc:creator><pubDate>Thu, 26 Jul 2007 08:12:54 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881116</link><description>&lt;p&gt;[...] Functional JavaScript at Oliver Steele (tags: javascript functional) [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jhorman.org - links for 2007-0</dc:creator><pubDate>Tue, 24 Jul 2007 21:31:04 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881115</link><description>&lt;p&gt;[...] Oliver Steele has a new library called Functional JavaScript that defines the standard higher-order functions (map, reduce, filter) as well as functions for partial function application and function-level programming: curry, partial, compose, guard, and until. Finally, it introduces â€œstring lambdasâ€, which let you write 'x -&amp;gt; x+1', 'x+1', or even '+1' as synonyms for function(x) {return x+1}. [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ajaxian » Functional JavaScrip</dc:creator><pubDate>Tue, 24 Jul 2007 14:46:54 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881114</link><description>&lt;p&gt;[...] Functional JavaScript at Oliver Steele In most languages, including JavaScript, invoking a function is one of the slowest things you can do. The implementations of languages designed for functional programming use a variety of techniques to optimize function calls. JavaScript is not one of tho (tags: JavaScript webdesign)    digg_url='&lt;a href="http://xiled.rss-central.net/blog/2007/07/23/links-for-2007-07-24/';" rel="nofollow noopener" target="_blank" title="http://xiled.rss-central.net/blog/2007/07/23/links-for-2007-07-24/';"&gt;http://xiled.rss-central.ne...&lt;/a&gt; digg_skin = 'compact'; digg_bgcolor = '#FFFFFF'; digg_title = 'links for 2007-07-24'; digg_bodytext = ''; digg_topic = '';   Powered by Gregarious (41) Share This [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">links for 2007-07-24</dc:creator><pubDate>Tue, 24 Jul 2007 02:28:40 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881112</link><description>&lt;p&gt;[...] Functional JavaScript at Oliver Steele “In most languages, including JavaScript, invoking a function is one of the slowest things you can do. The implementations of languages designed for functional programming use a variety of techniques to optimize function calls. JavaScript is not one of th (tags: functional fp declarative map reduce filter mapreduce javascript viapopular) [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">links for 2007-07-24 « Talkabo</dc:creator><pubDate>Tue, 24 Jul 2007 01:26:44 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881111</link><description>&lt;p&gt;[...] Functional JavaScript at Oliver Steele (tags: ** article development filter functions functional programming javascript library webdev haskell guide) [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">links for 2007-07-24 « Simply…</dc:creator><pubDate>Mon, 23 Jul 2007 22:44:06 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881110</link><description>&lt;p&gt;[...] Functional JavaScript (tags: programming javascript) [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">links for 2007-07-24 « Bloggit</dc:creator><pubDate>Mon, 23 Jul 2007 22:23:22 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881109</link><description>&lt;p&gt;[...] Functional JavaScript at Oliver Steele Functional is a JavaScript library for functional programming, a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. (tags: article filter javascript library programming tutorial tips functional development webdev webdesign) [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christopher Schmitt</dc:creator><pubDate>Mon, 23 Jul 2007 18:27:12 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881108</link><description>&lt;p&gt;I'm having great fun pouring over your library. It is very well written and I'm learning a lot about functional programming from reading the source.&lt;/p&gt;&lt;p&gt;Regarding speed, you can improve performance by giving up your favourite idiom:&lt;/p&gt;&lt;p&gt;var args = [].slice.call(arguments, 0);&lt;/p&gt;&lt;p&gt;This is expensive because it creates a new Array object every time you slice an arguments object. Which is very often.&lt;/p&gt;&lt;p&gt;Mozilla provides a static slice method on the Array object. Or you can fake it yourself:&lt;/p&gt;&lt;p&gt;if (!Array.slice) { // Mozilla already supports this&lt;br&gt;  Array.slice = function(array) {&lt;br&gt;    // Slice an array-like object.&lt;br&gt;    var slice = Array.prototype.slice;&lt;br&gt;    return slice.apply(array, &lt;a href="http://slice.call" rel="nofollow noopener" target="_blank" title="slice.call"&gt;slice.call&lt;/a&gt;(arguments, 1));&lt;br&gt;  };&lt;br&gt;}&lt;/p&gt;&lt;p&gt;And use it like this:&lt;/p&gt;&lt;p&gt;var args0 = Array.slice(arguments);    // cast to Array&lt;br&gt;var args1 = Array.slice(arguments, 1); // a normal slice&lt;/p&gt;&lt;p&gt;I use it so often I make it global.&lt;/p&gt;&lt;p&gt;var slice = Array.slice;&lt;br&gt;var args = slice(arguments);&lt;/p&gt;&lt;p&gt;Hope that helps. Back to reading your source code for me. :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dean Edwards</dc:creator><pubDate>Mon, 23 Jul 2007 18:22:34 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881107</link><description>&lt;p&gt;[...] Did you ever use Haskell?Haskell is a functional programming language (you’ll soon see what it means), and now, there’s a library for Functional JavaScript.And that’s what you can do with it: instead of…var numbers = [2, 93, 8894, 491, 7]; var sum = 0; for( var i = 0; i &amp;lt; numbers.length; i++ ) { sum += numbers[i] * 20; alert(sum); You would just say:alert( reduce( 'x+y', 0, map('*20', [2,93,8894,491,7]) ) );Okay, while this is just some loosy nonsense example, the possibilities opened up by the library are huge. Still, the greatest benefits from Functional JavaScript are higher order functions: now, even Currying or partial function application are possible!Look here:// Create functions on the fly! var divide = 'x/y'.lambda(); // Apply only one parameter and create a new function. var halve = divide.partial(_,2); alert( halve(6) ); // "3"! So… This is really, really hot so far. What’s missing are good functions for working with lists (or even List comprehension). Also, I’d doubt that this has good performance. However, especially in web desing, while working with DOM or those things, I’m sure Functional JavaScript will find it’s place.Give it a try, it’s hot! (And use the "live demo feature" on the site linked above!  ) [...]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">JaskellScript - the contented</dc:creator><pubDate>Mon, 23 Jul 2007 17:18:27 -0000</pubDate></item><item><title>Re: Functional JavaScript</title><link>http://blog.osteele.com/archives/2007/07/functional-javascript#comment-4881106</link><description>&lt;p&gt;I think it would be more readable if the map/filter/reduce functions worked on the enumerable objects themselves instead of having to be passed in.&lt;/p&gt;&lt;p&gt;Instead of this:&lt;br&gt;map('x*x', [1,2,3,4])&lt;/p&gt;&lt;p&gt;Why not this:&lt;br&gt;[1,2,3,4].map('x*x')&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Becker</dc:creator><pubDate>Mon, 23 Jul 2007 15:24:55 -0000</pubDate></item></channel></rss>