From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA09084 for caml-redistribution; Tue, 25 Feb 1997 13:35:31 +0100 (MET) 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 VAA26687 for ; Mon, 24 Feb 1997 21:42:31 +0100 (MET) Received: from prat.iway.fr (prat.iway.fr [194.98.0.6]) by nez-perce.inria.fr (8.7.6/8.7.3) with SMTP id VAA29105 for ; Mon, 24 Feb 1997 21:42:29 +0100 (MET) Received: from [194.98.4.51] (ts1-p12.dialup.iway.fr [194.98.4.51]) by prat.iway.fr (8.6.12/8.6.12) with SMTP id VAA23489 for ; Mon, 24 Feb 1997 21:40:59 +0100 Date: Mon, 24 Feb 1997 21:40:59 +0100 X-Sender: bonnardv@mail.pratique.fr Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Mailer: Eudora F1.5.3 To: caml-list@inria.fr From: bonnardv@pratique.fr (Valentin Bonnard) Subject: Re: string variables in Printf.* calls: Bug, or lack of understanding? Sender: weis [English summary at the end] >> Dans ce cas, comment avoir un record (en Caml-light): >> >> type Rec = { x: ('a, 'b, 'c) printf__format };; >> >> ne marche pas (variable 'a non lie'e). > >Apprenez le langage. type ('a, 'b, 'c) Rec = ... Je veut bien, mais le record a plus de 10 champs ce qui fait 30 variables de type pour qqchose qui n'est pas polymorphe ! (Meme si pour Caml-light il l'est, du point de vu du 'domaine du probleme' comme on dit, on a des chaines indiquand un format; il n'y a aucun polymorphisme la dedans.) De plus je ne sais pas comment innitialiser les champs: let f = { x = "toto" };; ne fonctionne pas. Tout cela signifie t'il que l'ordre dans lequel est fait le typage est important ? ******** I want to have a record (in Caml-light) with printf format strings. type Rec = { x: ('a, 'b, 'c) printf__format };; doesn't work because the vars a, b end c aren't bound. I have more then 10 fields in the record so does it means I need 30 type vars ? Also I don't know how to create an instance of this type. BTW does the type-system depend on the order in which things are typed ? Valentin Bonnard mailto:bonnardv@pratique.fr http://www.pratique.fr/~bonnardv (Informations sur le C++ en Francais)