From: John Cowan <[email protected]>
Subject: Re: [r6rs-discuss] New features for small Scheme, part 7 bis: custom
ports
Date: Mon, 14 Sep 2009 16:07:44 -0400
> > * If we have a close operation, should it be invoked when the port
> > is GCed?
>
> Yes, I think so. This was discussed on #scheme.
It can be tricky. The GC may decide a port is a garbage
and should be cleaned up while one of the port's operation
are being executed. It is ok but the standard should be
clear whether that can happen or not, I think.
> > If we don't need to change those procedures once they're set,
> > then it's clearer that we make them immutable, and give them
> > at construction time.
>
> It is indeed clearer, though it suffers from the inflexibility
> I mentioned in my posting.
Can the inflexibility be addressed by making the constructor
take plist? For example:
(make-custom-input-port 'read-char (lambda () ...)
'peek-char (lambda () ...))
Well, it's a bit ugly but at least flexible.
(Oh, and I hope we don't go into the discussion of
introducing keyword type...)
--shiro
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss