-
Update Is Not Update
I ran into this little problem yesterday and thought I would share it. I needed to collect a bunch of items into a list, and I needed to do that from several functions that functioned as callbacks.
Read more… -
Continuations and `tailr`
Tail recursion is essential in functional programming languages because they can be used to transform function calls into loops. If all recursive calls are the final results of a function call, i.
Read more… -
More Linked List Performance
I’m still working on improving the speed of my pattern matching DSL. I have improved the speed of constructors and pattern matching, so now I wanted to get back to comparing vectors and linked lists.
Read more… -
The Cost of Pattern Matching
Following up on my previous post, where I figured out to improve the speed of constructors, I will have a look at pattern matching in this post. I haven’t added any of this to pmatch yet.
Read more… -
The Cost of Constructors
So, err, I wanted to compare the performance of linked lists versus R vectors on a case where the former is expected to perform better than the second: building a sequence one element at a time.
Read more… -
Thunks and Trampolines
Have you ever written a recursive function that you couldn’t use because you ran out of stack space when you applied it to large data sizes? Then thunks and trampolines might be for you.
Read more… -
Lazy queues
The purpose of the lazy lists I implemented in my previous post was to build lazy queues. Lazy lists give you constant time concatenation, which can be useful in itself, but I needed it to implement persistent functional queues.
Read more… -
Lazy lists
I wanted to write about lazy lists and lazy queues today, but I spent most of the day struggling with getting lazy evaluation to work. Finally, I convinced myself that something was broken in R, and I was justified in thinking that; upgrading to the most recent version resolved the issue.
Read more… -
Promises, their environments, and how we evaluate them
Have you ever wondered how functions are evaluated? How you can have arguments that would raise errors, but do not, or how default arguments can be expressions that depend on function arguments that you haven’t seen yet when you define a function?
Read more… -
Lists and functional queues
I wanted to write something about function parameters, how these are passed as so-called “promises”, how these have associated scopes (and the consequences of that), and how they give us lazy evaluation.
Read more…