On Thu, Feb 28, 2008 at 10:05:58AM -0500, Graham Fawcett wrote: > > Why the thunk? (why not directly the port?) > > Laziness: it avoids the overhead of setting up the input port if it's > not required. You might want to iterate over a set of (id, name, blob) > records and only open the blob if the name meets some criteria that > are local to the app (i.e. can't be expressed in a WHERE clause).
You can make a 'smart' custom port that only really opens the blob when you first read from it (it has to be a custom port anyway, so this is not too much extra work). This makes for a more convenient API, IMHO. Cheers, Peter -- http://sjamaan.ath.cx -- "The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." -- Donald Knuth
pgpIyFIIGhZsD.pgp
Description: PGP signature
_______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users