[bitc-dev] Iterators

Sandro Magi naasking at higherlogics.com
Thu Feb 26 22:14:38 EST 2009


Jonathan S. Shapiro wrote:
>> Iterator == lazy list is another way to approach it, and results in a
>> slightly different structure.
> 
> Yeah, but BitC is eager evaluated, so I'm thinking that doesn't work out for us.

The semantics are virtually identical as for an iterator. A lazy type in
an eager language is simple enough:

module Lazy =
struct
  type 'a lazy
  val create: (() -> 'a) -> 'a lazy
  val force: 'a lazy -> 'a
end

module Iter =
struct
  type 'a type
  val current: 'a type -> 'a * 'a type lazy
end

Sandro



More information about the bitc-dev mailing list