« Hamatai! | Main | XPDay London »

October 10, 2007

Comments

Phil

Educational post. I've also been learning OCaml lately, but I'm purposefully staying away from it's OO features (and other non-functional features like references) initially so as to force myself to think functionally. Some people do this by learning Haskell because it's purely functional, but I figure I can get the same effect by learning the purely functional aspect of OCaml first and then after my functional-mindset has been built I can move onto those non-functional aspects of the language.... (and I'm trying not to cheat ;-)

Wilkes Joiner

Another way to minimize parameter passing in a functional way is to use higher order functions and closures. Maybe that is what the bracket function is leveraging, but I would need more context to say.

"An object is a poor man's closure."
"A closure is a poor man's object."
- some lisper

Vesa Karvonen

First of all, I think that you are doing yourself a disservice by using objects in OCaml. Given your OO background, I can understand why you do it. If you wish to learn functional and higher-order programming in OCaml, I would recommend to stay away from objects. (Sidenote: I prefer to distinguish between functional, meaning no side-effects, and higher-order, meaning with first-class functions.) You might even want to start with a simpler language, like Standard ML, that doesn't distract you with OO.

I've designed a few test frameworks in higher-order languages. Here is a simple way to think about tests. SNIPPED. I wanted to write example code, but the blog software doesn't recognize indented text as preformatted and after googling for a few minutes I didn't find instructions on how to include preformatted text.

The comments to this entry are closed.