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

weird Printf behavior #2379

Closed
vicuna opened this issue Mar 25, 2004 · 1 comment
Closed

weird Printf behavior #2379

vicuna opened this issue Mar 25, 2004 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 25, 2004

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

Bug description

hi,

i am pretty new to ocaml so it might be me, but it should be easy
enough for you to check: in the first result, the second string is
crippled. i am using debian ocaml packages 3.04-14 and 3.07.2a-2.

======================================================================

List.map (Printf.sprintf "c%sc") ["i"; "i"];;

  • : string list = ["cic"; "ic"]

[Printf.sprintf "c%sc" "i"; Printf.sprintf "c%sc" "i"];;

  • : string list = ["cic"; "cic"]
    ======================================================================

curious to hear what this is about. thanks for giving the world this
great language!

cheers,
matthias

@vicuna
Copy link
Author

vicuna commented Mar 25, 2004

Comment author: administrator

Hello,

hi,

i am pretty new to ocaml so it might be me, but it should be easy
enough for you to check: in the first result, the second string is
crippled. i am using debian ocaml packages 3.04-14 and 3.07.2a-2.

======================================================================

List.map (Printf.sprintf "c%sc") ["i"; "i"];;

  • : string list = ["cic"; "ic"]

[Printf.sprintf "c%sc" "i"; Printf.sprintf "c%sc" "i"];;

  • : string list = ["cic"; "cic"]
    ======================================================================

curious to hear what this is about. thanks for giving the world this
great language!

This is not a bug, and is detailed in the Printf module documentation:
http://caml.inria.fr/ocaml/htmlman/libref/Printf.html
(see last paragraph about the fprintf function).

Regards,

--
Maxence Guesdon

@vicuna vicuna closed this as completed Mar 25, 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