?

Log in

No account? Create an account
penrose orange

stephenw32768


/var/log/stephen

cat /var/log/stephen >/dev/eyes


Code is data
penrose orange
stephenw32768
Approximating a C-style "for" loop in a functional language:

def for_loop [T]
(initial : T, condition : T -> bool, continuation : T -> T, body : T -> void)
{
  if(condition(initial)) {
    body(initial);
    for_loop(continuation(initial), condition, continuation, body);
  }
  else
    initial;
}


Functional languages intrigue me. I wasn't much good with them at university, but I've now got sufficient experience at working with closures in Ruby and C# that I'd probably get along much better with them.