private/mpost-utils.rkt
#lang racket
(provide char->string to-string op-concat)
(require (planet wcy/anaphora))
(define (char->string c) (make-string 1 c))
(define (to-string s)
  (cond
   ((null? s) "")
   ((char? s)
    (char->string s))
   ((string? s) s)
   ((symbol? s)
    (symbol->string s))    
   ((number? s) 
    (aprogn
     (/ s 1/65536)
     (truncate it)
     (* it (exact->inexact 1/65536))
     (number->string it)))
   ((pair? s) (string-append (to-string (car s)) " " 
                             (to-string (cdr s))))
   (else (error "bad type" s))))
(define ((op-concat a) . args)
  (string-join (map to-string args) (to-string a)))