1
1
mirror of https://github.com/kanaka/mal.git synced 2024-08-16 17:20:23 +03:00

FIX: print zero without minus

This commit is contained in:
Fabian 2021-03-26 11:06:55 +01:00 committed by Joel Martin
parent c6115098cc
commit a2d0d6ce43

View File

@ -2,5 +2,5 @@ fun prStr NIL = "nil"
| prStr (SYMBOL s) = s
| prStr (BOOL true) = "true"
| prStr (BOOL false) = "false"
| prStr (INT i) = if i > 0 then Int.toString i else "-" ^ (Int.toString (Int.abs i))
| prStr (INT i) = if i >= 0 then Int.toString i else "-" ^ (Int.toString (Int.abs i))
| prStr (LIST l) = "(" ^ (String.concatWith " " (map prStr l)) ^ ")" (* N.B. not tail recursive *)