Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#266] Pretty printing regression in SML/NJ 110.98

Date:
2020-07-19 10:35
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
David MacQueen (dbm)
Machine Architecture:
x86
Operating System:
MacOS X
Component:
Other
Resolution:
Fixed
Severity:
Major
OS Version:
Mojave
SML/NJ Version:
v110.98
Keywords:
pretty printing
URL:
Transcript (of reproduction):
$ sml Standard ML of New Jersey (32-bit) v110.98 [built: Fri Jul 17 14:37:19 2020] - use "hw1-1.sml"; [opening hw1-1.sml] val is_older = fn : (int * int * int) * (int * int * int) -> boolval test1 = true : boolval test2 = true : boolval test3 = true : boolval test4 = true : bool val it = () : unit -
Source (for reproduction):
fun is_older (date1 : int * int * int, date2 : int * int * int) = let val y_delta = #1 date2 - #1 date1 in if (y_delta < 0) then false else if (y_delta > 0) then true else let val m_delta = #2 date2 - #2 date1 in if (m_delta < 0) then false else if (m_delta > 0) then true else let val d_delta = #3 date2 - #3 date1 in if (d_delta < 0) then false else if (d_delta > 0) then true else false end end end val test1 = is_older ((2,3,4),(1,2,3)) = false val test2 = is_older ((1,2,3),(2,3,4)) = true val test3 = is_older ((2,3,4),(2,3,4)) = false val test4 = is_older ((2,3,4),(2,3,5)) = true
Summary:
Pretty printing regression in SML/NJ 110.98

Detailed description
REPL output is not formatted correctly.
Additional comments:
$ sml
Standard ML of New Jersey (64-bit) v110.97 [built: Tue Apr 21 17:39:48 2020]
- use "hw1-1.sml";
[opening hw1-1.sml]
val is_older = fn : (int * int * int) * (int * int * int) -> bool
val test1 = true : bool
val test2 = true : bool
val test3 = true : bool
val test4 = true : bool
val it = () : unit
-

Submitted via web form by Craig H Maynard <chmaynard@gmail.com>

Comments:

Message  ↓
Date: 2020-08-25 13:12
Sender: John Reppy

Fixed by reverting pretty-printing code to 110.97

Date: 2020-07-20 14:34
Sender: John Reppy

The pretty printer is not putting line breaks between the specifications.

Attached Files:

Changes

Field Old Value Date By
status_idOpen2020-08-25 13:12jhr
close_dateNone2020-08-25 13:12jhr
ResolutionAccepted As Bug2020-08-25 13:12jhr
assigned_tonone2020-07-20 14:34jhr
summaryRegression in SMLNJ 110.982020-07-20 14:34jhr
detailsREPL output is not formatted correctly. Additional comments: $ sml Standard ML of New Jersey (64-bit) v110.97 [built: Tue Apr 21 17:39:48 2020] - use "hw1-1.sml"; [opening hw1-1.sml] val is_older = fn : (int * int * int) * (int * int * int) -> bool val test1 = true : bool val test2 = true : bool val test3 = true : bool val test4 = true : bool val it = () : unit - Submitted via web form by Craig H Maynard <chmaynard@gmail.com> 2020-07-20 14:34jhr
ResolutionNone2020-07-20 14:34jhr
Transcript (of reproduction)$ sml Standard ML of New Jersey (32-bit) v110.98 [built: Fri Jul 17 14:37:19 2020] - use "hw1-1.sml"; [opening hw1-1.sml] val is_older = fn : (int * int * int) * (int * int * int) -> boolval test1 = true : boolval test2 = true : boolval test3 = true : boolval test4 = true : bool val it = () : unit - 2020-07-20 14:34jhr
Source (for reproduction)fun is_older (date1 : int * int * int, date2 : int * int * int) = let val y_delta = #1 date2 - #1 date1 in if (y_delta < 0) then false else if (y_delta > 0) then true else let val m_delta = #2 date2 - #2 date1 in if (m_delta < 0) then false else if (m_delta > 0) then true else let val d_delta = #3 date2 - #3 date1 in if (d_delta < 0) then false else if (d_delta > 0) then true else false end end end val test1 = is_older ((2,3,4),(1,2,3)) = false val test2 = is_older ((1,2,3),(2,3,4)) = true val test3 = is_older ((2,3,4),(2,3,4)) = false val test4 = is_older ((2,3,4),(2,3,5)) = true2020-07-20 14:34jhr