From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 36644BB83 for ; Thu, 17 Aug 2006 05:49:52 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k7H3npeK024528 for ; Thu, 17 Aug 2006 05:49:51 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA24828 for ; Thu, 17 Aug 2006 05:49:50 +0200 (MET DST) Received: from comtv.ru ([217.10.32.17]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7H3nkI1013689 for ; Thu, 17 Aug 2006 05:49:50 +0200 X-UCL: actv Received: from av1474.oops ([10.0.66.9] verified) by comtv.ru (CommuniGate Pro SMTP 4.1.8) with ESMTP id 164485801; Thu, 17 Aug 2006 07:49:41 +0400 Date: Thu, 17 Aug 2006 07:49:39 +0400 (MSD) From: malc X-X-Sender: malc@home.oyster.ru To: Nathaniel Gray Cc: Caml List Subject: Re: [Caml-list] Help interfacing with C In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 44E3E75F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; malc:01 malc:01 pulsesoft:01 interfacing:01 fdlist:01 pairs:01 fdset:01 fdlist:01 fdset:01 newres:01 val:01 newres:01 val:01 pulsesoft:01 2006,:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Wed, 16 Aug 2006, Nathaniel Gray wrote: > Hi folks, > > I'm having a heck of a time figuring out why this code *doesn't* work: > > /* fdlist is a list of (file_descr * 'a) pairs. Filter by FD_ISSET */ > static value fdset_to_fdlist2(value fdlist, fd_set *fdset) > { > value l, p, newres; > value res = Val_int(0); > > Begin_roots4(l, p, res, newres); /* I know, this is aggressive */ > for (l = fdlist; l != Val_int(0); l = Field(l, 1)) { > p = Field(l, 0); > int fd = Int_val(Field(p, 0)); This here (expanded) does Int_val (Field (Field (l, 0), 0)) > int fd = Int_val(Field(l, 0)); I think the difference is self-evident. -- mailto:malc@pulsesoft.com