On Wed 06 Apr 2016 01:55, Matt Wette <matthew.we...@verizon.net> writes:

>> On Apr 5, 2016, at 7:06 AM, Mark H Weaver <m...@netris.org> wrote:
>> 
>> Matt Wette <matthew.we...@verizon.net> writes:
>> 
>>>> On Mar 28, 2016, at 12:04 PM, Andy Wingo <wi...@pobox.com> wrote:
>>>> I am working on improving our port implementation to take advantage of
>>>> the opportunity to break ABI in 2.2.  I am wondering how much I can
>>>> break C API as well -- there are some changes that would allow better
>>>> user-space threading
>>> 
>>> I made an attempt to use soft ports, but backed out after I could not
>>> figure a way to extra data I wanted to associate with my port.
>>> 
>>> Addition of an access function to user-defined data would enlarge the
>>> cases for which soft ports could be used.
>> 
>> Object properties can be used to associate extra information with any
>> object that has identity, which includes ports.  See
>> 'make-object-property' in the Guile manual.
>
> Thanks.  I had forgotten about that. — Matt

I think for soft ports (and custom binary i/o ports) the idea is
actually that the "handler" procedures are actually closures.  I.e.

  (let ((my-obj ...))
    (make-soft-port (vector (lambda (c) (do-write my-obj c)) ...) modes))

No need for extra arguments if you have closures.

Andy

Reply via email to