From: Nicolas C. <war...@fr...> - 2003-06-23 02:27:42
|
> > On Fri, 20 Jun 2003, Nicolas Cannasse wrote: > > > This is one place where has_next would be usefull. we have it : Enum.empty : 'a t -> bool > But it is a significant change in semantics because > > it requires one element lookahead. Some data structures > cannot support that without side effects, for example > reading the next line of a file. Enum is handling that for you , but it have a cost since you're needing to do some functional trick. The way iter2 is currently implemented is better thab using empty every time (the element is only pushed back in the enum once). Nicolas Cannasse |