Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string_to_format #8472

Closed
vicuna opened this issue Feb 4, 2004 · 1 comment
Closed

string_to_format #8472

vicuna opened this issue Feb 4, 2004 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 4, 2004

Original bug ID: 2160
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Kévin Séjourné
Version: 3.07pl2
OS: debian
Submission from: aste-genev-bois-104-1-2-235.w80-11.abo.wanadoo.fr (80.11.230.235)

Dans le module Pervasives.
La fonction string_to_format est déclarée comme cela :
external format_of_string :
('a, 'b, 'c, 'd) format4 -> ('a, 'b, 'c, 'd) format4 = "%identity"

C'est curieux car cela semble ne rien faire du tout.

La fonction ne devrais elle pas etre declarée comme cela?
external format_of_string :
string -> ('a, 'b, 'c, 'd) format4 = "%identity"

http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/ocaml/stdlib/pervasives.ml?rev=1.75&content-type=text/x-cvsweb-markup

Dans le cas où cela n'est pas un "bug" je trouve que la fonction
n'est pas assez documentée pour en comprendre l'interet.

@vicuna
Copy link
Author

vicuna commented Feb 5, 2004

Comment author: administrator

Full_Name: Kévin Séjourné
Version: 3.07pl2
OS: debian
Submission from: aste-genev-bois-104-1-2-235.w80-11.abo.wanadoo.fr (80.11.230.235)

Dans le module Pervasives.
La fonction string_to_format est déclarée comme cela :
external format_of_string :
('a, 'b, 'c, 'd) format4 -> ('a, 'b, 'c, 'd) format4 = "%identity"

C'est curieux car cela semble ne rien faire du tout.

La fonction ne devrais elle pas etre declarée comme cela?
external format_of_string :
string -> ('a, 'b, 'c, 'd) format4 = "%identity"

http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/ocaml/stdlib/pervasives.ml?rev=1.75&content-type=text/x-cvsweb-markup

Dans le cas où cela n'est pas un "bug" je trouve que la fonction
n'est pas assez documentée pour en comprendre l'interet.

Merci pour votre rapport d'erreur.

En fait il n'y a pas d'erreur, la fonction doit réellement être
déclarée avec ce type.

En ce qui concerne la documentation, vous avez sans doute raison;
précisons qu'en fait l'appel [format_of_string s] retourne une chaîne
de format lue dans le littéral chaîne de caractères [s]. La fonction
format_of_string est donc utile pour lire des chaînes de format dans
des littéraux chaînes de caractères. Par exemple:

    Objective Caml version 3.07+13 (2004-01-04)

format_of_string "Un nombre %d\n";;

  • : (int -> '_a, '_b, '_c, '_a) format4 =

Si vous avez une meilleure explication pour la documentation (plus
simple à comprendre, plus claire ou plus succinte), merci de nous la
proposer.

Cordialement,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/

@vicuna vicuna closed this as completed Feb 5, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant