Sjoerd Visscher's weblog

My ideas about new web technology that can change the future of the world wide web.

Last Update

12/8/2002; 2:57:07 AM

Weblog Search

Don't like the look of this site?

XML coffee mug
Click to see the XML version of this web page.

Updated with

Click here to visit the Radio UserLand website.

Monday, November 25, 2002

FP with Loell

I've updated Loell to better support functional programming. In Javascript you can do functional programming, but you cannot do it in an object oriented way. You can hardly ever use a method, because for this to have a value, the method has to be a property of an object. In Loell, a method call looks like this:

expr method expr

The value of the left-hand expression is assigned to this and the value of the right-hand expression is assigned to that. So 1 {this+that} 2 evaluates to 3. On the Loell page I've added an example that implements lists and adds foldr and foldl, in a proper object oriented way (I think).