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

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 26, 2015

Comment author: @gasche

Fixed in trunk and 4.02.

@vicuna vicuna closed this 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
You can’t perform that action at this time.