From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 818FEBCAE for ; Thu, 30 Jun 2005 13:14:08 +0200 (CEST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.207]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5UBE7pA009557 for ; Thu, 30 Jun 2005 13:14:08 +0200 Received: by rproxy.gmail.com with SMTP id a36so98468rnf for ; Thu, 30 Jun 2005 04:14:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=t57LMBwqouLieaSmK1z3al7sni/KDERgOfiNRPaU+fHAo8Q6LSUbSTjnySbN/wXmdkI+Eo2vqUkT3YRYrUTyE/eNrtoQo9ayg9DWEigdY2FBcKxfRHnkvxOVCeskJzrZIepUfxspcE2RmS2zvGn/IVWPAF1XS5XTotX83lVbL8s= Received: by 10.38.208.73 with SMTP id f73mr546870rng; Thu, 30 Jun 2005 04:14:07 -0700 (PDT) Received: by 10.38.209.44 with HTTP; Thu, 30 Jun 2005 04:14:07 -0700 (PDT) Message-ID: Date: Thu, 30 Jun 2005 23:14:07 +1200 From: Jonathan Roewen Reply-To: Jonathan Roewen To: caml-list@yquem.inria.fr Subject: [Caml-list] enumerations & ioctls Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 42C3D3FF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 type-safe:01 ioctl:01 variants:01 polymorphic:01 types:02 driver:04 structure:04 interface:05 identical:06 i'm:08 function:08 aren't:11 sets:12 some:12 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: Hi, I'm about to endeavour into designing a driver interface for my OS project, and I have some questions about making a type-safe ioctl-like function. Since different device types have different sets of ioctl calls it can accept, I need to be able to have a structure that I can put different devices into, implying the enumerations aren't identical. Is the best way to achieve this with those polymorphic variants? And how much does this affect type safety? Jon