spec: format — CL-style string formatting (~a ~s ~d ~x ~o ~b ~f ~% ~& ~~ ~t)
28 tests, passes on both JS and OCaml. - spec/stdlib.sx: pure SX format function - spec/primitives.sx: format primitive declaration - lib/r7rs.sx: fix number->string to support optional radix arg - hosts/ocaml: add format-decimal primitive, load stdlib.sx in test runner - hosts/javascript: load stdlib.sx in test runner Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,10 @@
|
||||
|
||||
(define string->symbol make-symbol)
|
||||
|
||||
(define number->string (fn (n) (str n)))
|
||||
(define number->string
|
||||
(let ((prim-n->s number->string))
|
||||
(fn (n &rest r)
|
||||
(if (nil? r) (str n) (prim-n->s n (first r))))))
|
||||
|
||||
(define
|
||||
string->number
|
||||
|
||||
Reference in New Issue
Block a user