ref: 008529cafa91d5f05b4e3db7db8cd165859acc47
parent: 1ac0bb9cd95650fd0029f354f874974d1772a601
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Aug 7 18:33:01 EDT 2015
Don't print stray ','s in bit sets.
--- a/libstd/fmtfuncs.myr
+++ b/libstd/fmtfuncs.myr
@@ -38,16 +38,16 @@
}
const bsfmt = {sb, ap, opts
- var i, bs
+ var i, bs, sep
bs = vanext(ap)
+ sep = ""
sbputs(sb, "bitset{")
for i = 0; i < bsmax(bs); i++
if bshas(bs, i)
- if i != 0
- sbfmt(sb, ", ")
- ;;
+ sbfmt(sb, sep)
sbfmt(sb, "{}", i)
+ sep = ", "
;;
;;
sbputs(sb, "}")