Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: bonnardv@pratique.fr (Valentin Bonnard)
To: caml-list@inria.fr
Subject: Re: string variables in Printf.* calls: Bug, or lack of understanding?
Date: Mon, 24 Feb 1997 21:40:59 +0100	[thread overview]
Message-ID: <v01530500af37b857ebb9@[194.98.4.65]> (raw)

[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)







             reply	other threads:[~1997-02-25 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-24 20:40 Valentin Bonnard [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-02-13 18:31 T. Kurt Bond
1997-02-18 16:39 ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='v01530500af37b857ebb9@[194.98.4.65]' \
    --to=bonnardv@pratique.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox