On Thu, Feb 28, 2008 at 10:30 AM, Peter Bex <[EMAIL PROTECTED]> wrote: > 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.
That's true. I was going to argue that it doesn't have to be a custom port (some interfaces may return a TCP port to consume the blob, for example) and that I'd rather not add an extra layer. But using a custom port would also ensure that the right cleanup code was called, and that's a big win. The custom-port is a good solution. G _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
