caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Joel Reymont <joelr1@gmail.com>
To: Pedro Borges <pdhb.lists@gmail.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] do i need a private row type?
Date: Thu, 19 May 2011 09:33:01 +0200	[thread overview]
Message-ID: <374F68E6-6CD0-4221-A9A1-9A02AB4362DF@gmail.com> (raw)
In-Reply-To: <BANLkTimPMjrzUamrEJqgbAU7jdTFjoEKbA@mail.gmail.com>


On May 19, 2011, at 6:15 AM, Pedro Borges wrote:

> the current version is a bit ahead of your version I think.

Maybe, maybe not :-). 

> you can cast any socket type to (generic Socket.t) so you can have
> different socket types inside the poll.

I don't need to cast in my new phantom types version, I can just stick the various 
sockets into the poll mask, regardless of type. There's no type loss information either
because I don't return sockets, I return flags, e.g.

module Poll : sig

  type t

  type poll_event = In | Out | In_out
  type poll_socket = [`Pair|`Pub|`Sub|`Req|`Rep|`Dealer|`Router|`Pull|`Push] Socket.t
  type poll_mask = (poll_socket * poll_event)

  val mask_of : poll_mask array -> t
  val poll : ?timeout: int -> t -> poll_event option array

end

This also does not rely on OCaml figuring out that the socket I returned is the same
as the socket I put in. I know that the returned flags in position N apply 
to the socket in the same position in the poll mask.

> This weekend I'm going to look at the bindings again. They need a serious fix.

I have fixed the bindings enough for our ad serving use. Please take a look at 
the batch of commits in your pull queue on Github.

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------





      reply	other threads:[~2011-05-19  7:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-15 13:56 Joel Reymont
2011-05-16  6:24 ` Goswin von Brederlow
2011-05-16  7:07   ` Gabriel Scherer
2011-05-16  8:57     ` Joel Reymont
2011-05-16  9:31     ` Joel Reymont
2011-05-16  9:58     ` Joel Reymont
2011-05-16 10:05     ` Joel Reymont
2011-05-16 12:02     ` Joel Reymont
2011-05-16 12:32     ` Joel Reymont
2011-05-16 13:02     ` Joel Reymont
2011-05-16 13:39       ` Gabriel Scherer
2011-05-16 13:46         ` Joel Reymont
2011-05-16 14:02         ` Joel Reymont
2011-05-16 14:06           ` Gabriel Scherer
2011-05-16 14:08             ` Joel Reymont
2011-05-17  4:26     ` Goswin von Brederlow
2011-05-19  4:15 ` Pedro Borges
2011-05-19  7:33   ` Joel Reymont [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=374F68E6-6CD0-4221-A9A1-9A02AB4362DF@gmail.com \
    --to=joelr1@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=pdhb.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).