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 CAA14882; Thu, 17 Oct 2002 02:47:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 CAA15067 for ; Thu, 17 Oct 2002 02:47:38 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from athlon.baretta.com (host141-68.pool80116.interbusiness.it [80.116.68.141]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9H0lbD16657 for ; Thu, 17 Oct 2002 02:47:38 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id DF5B627250; Thu, 17 Oct 2002 02:58:17 +0200 (CEST) Message-ID: <3DAE0B29.4090305@baretta.com> Date: Thu, 17 Oct 2002 02:58:17 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: it, en MIME-Version: 1.0 To: climb Cc: "caml-list@inria.fr" Subject: [Caml-list] Re: how to start References: <200210161407.g9GE7r505067@concorde.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk climb wrote: > Dear caml-list > > i am a new commer of Caml language. Welcome on board! > and start with online mannul > i am confused at this sentence in Chapter 1 > # type idref={ mutable id : 'a. 'a -> 'a};; > what does "." mean? 'a. 'a -> 'a This is read as: "For every type 'a, a function from 'a to 'a". In this context 'a is a type variable. The type variable preceding the "." are "universally quantified": this is where the "For every type ..." comes into the game. This basically states that the type of id is polymorphic: 'a -> 'a is a type schema as opposed to a specific type. Many different types fit this schema: int -> int string -> string (int -> int) -> (int -> int), and so on. The type schema 'a. 'a -> 'a is entirely equivalent to the axiom schema of propositional calculus A => A: "If A then A." A stands for *any* proposition, not for any one specific proposition. > why i can not write > # type intidref= { mutable id : int. int->int};; This does not make sense because "int" is a type value and not a type variable. Alex ------------------- 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