It was a century ago... yet I think it should be:
@assert(length(f) == length(breakpts)+1)
in the previous function!
Stefano