Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] custom channels
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] custom channels
>   I want to ask Caml developers about one feature...
>   Can you officially describe (in the next OCaml package,
> for example) the creating of channels with custom
> input/output/..etc.. functions?  (C or Caml interface -
> it doesn't matter)

If you want your channels to have type in_channel or out_channel, and
be usable with the I/O functions provided by the standard library,
then this is not possible with the current implementation.

However, it is easy to define your own types my_in_channel, my_out_channel
that wrap the system channel types, as well as your own channels, and
provide operations that dispatch on the channel kind, either using
variant types, records of functions, or objects.

- Xavier Leroy
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: