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 behavior with partial application of Format.asprintf. #6824

Closed
vicuna opened this issue Mar 30, 2015 · 2 comments
Closed

Weird behavior with partial application of Format.asprintf. #6824

vicuna opened this issue Mar 30, 2015 · 2 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Mar 30, 2015

Original bug ID: 6824
Reporter: @alainfrisch
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:48:57Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: standard library
Tags: patch
Monitored by: @dbuenzli

Bug description

As illustrated by the code below:

let f = Format.asprintf "[%i]";;

val f : int -> string =

f 1;;

  • : string = "[1]"

f 2;;

  • : string = "[1][2]"

which is at odds with:

let f = Format.sprintf "[%i]";;

val f : int -> string =

f 1;;

  • : string = "[1]"

f 2;;

  • : string = "[2]"

File attachments

@vicuna
Copy link
Author

vicuna commented Mar 30, 2015

Comment author: @gasche

I think the attached patch fixes the issue. I may merge it on my next merge window.

PS: when reporting format issues it helps if you can test whether it was present on the pre-GADT implementation (4.01 or before) -- if it is clearly a regression of the new engine, the fact that fixing it is a good idea is a no-brainer. It is in this case.

@vicuna
Copy link
Author

vicuna commented Apr 26, 2015

Comment author: @gasche

Fixed in trunk and 4.02.

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added the stdlib label Mar 14, 2019
@vicuna vicuna added this to the 4.02.2 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants