
22 Nov
2009
22 Nov
'09
3:25 p.m.
2009/11/22 Daniel Fischer
I never noticed the docs didn't say anything about the complexity of length. That should indeed be mentioned.
Maybe not too usual, neither the OCaml or MzScheme docs mention that length is not constant time (caveat - I'm not at the latest release of either). Actually I was a bit surprised that getting the length in MzScheme was an iterative calculation rather than constant-time lookup, it's something I never noticed in years of using MzScheme. http://caml.inria.fr/cgi-bin/viewcvs.cgi/ocaml/trunk/stdlib/list.ml?rev=7597&view=markup http://svn.plt-scheme.org/plt/trunk/src/mzscheme/src/list.c see scheme_list_length Best wishes Stephen