From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA17784; Sat, 17 Apr 2004 02:35:46 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA17140 for ; Sat, 17 Apr 2004 02:35:45 +0200 (MET DST) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3H0ZhYM005328 for ; Sat, 17 Apr 2004 02:35:44 +0200 Received: (qmail 29289 invoked by uid 64014); 17 Apr 2004 00:35:42 -0000 Received: from shawnw@speakeasy.org by mail3.speakeasy.net with AmikaGuardian-Server-2.1.2; 17 Apr 2004 00:35:42 -0000 X-AmikaGuardian-Id: mail3.speakeasy.net108216214126129280 X-AmikaGuardian-Category: AN:Override Structure : 2.75 X-AmikaGuardian-Category: AN:Vectored : 2.75 X-AmikaGuardian-Category: AN:Forwarded Mail : 2.75 X-AmikaGuardian-Category: AN:Override : 2.75 X-AmikaGuardian-Category: AN:Exception : 2.75 X-AmikaGuardian-Action: Do Nothing() Received: from dialup-4.242.123.65.dial1.seattle1.level3.net (HELO sherlock.localdomain) (shawnw@[4.242.123.65]) (envelope-sender ) by mail3.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 17 Apr 2004 00:35:41 -0000 Received: by sherlock.localdomain (Postfix, from userid 502) id 3DE08FBE9; Fri, 16 Apr 2004 17:34:42 -0700 (PDT) Date: Fri, 16 Apr 2004 17:34:42 -0700 From: Shawn Wagner To: caml-list Subject: Re: [Caml-list] help Message-ID: <20040417003442.GA848@speakeasy.org> Mail-Followup-To: caml-list References: <1082141984.20063.184.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1082141984.20063.184.camel@pelican.wigram> User-Agent: Mutt/1.4.2i X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; shawnw:01 caml-list:01 2004:99 2004:99 pointers:01 struct:01 reinventing:01 pointers:01 foo:01 foo:01 printf:01 printf:01 isspace:01 isspace:01 isalpha:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, Apr 17, 2004 at 04:59:45AM +1000, skaller wrote: > On Sat, 2004-04-17 at 04:04, mohammad siddiqui wrote: > > Hi, > > I started the conversion project after completely getting hold of ocaml but > > I still have some concerns like how we can manage pinters and pointer to > > pointers, > > Generally you don't need them. Here is an example: in C: > > struct ilist { list *next; int v; }; > > In Ocaml: > > type ilist = Cons of int * ilist | Empty This seems like a bad example, as you're just reinventing int list with it. C pointers are something like ocaml references. C: int *foo = &bar; *foo = 12; printf("%d", *foo); Ocaml: let foo = ref bar in foo := 12; Printf.printf "%d" !foo except that the value of bar won't be changed in the latter. > > > some functions in C like exit(), isspace(). > > exception Exit > The Exit exception is not raised by any library function. It is provided > for use in your programs. There's also the exit function, which does the same thing as C exit(), and doesn't cause a message about an uncaught exception... > > isspace is easy to implement: > > let isspace = function > | ' ' | '\t' -> true > | _ -> false \r, \n and some other characters also count as whitespace. The C character classification routines (isspace, isalpha, etc.) are part of extlib. -- Shawn Wagner shawnw@speakeasy.org ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners