impc:ti:sprintln   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmti.xtm

Implementation

(define impc:ti:sprintln
  (lambda (ast)
    (if (null? ast)
        (String "")
        `(memzone 1024
           (cat
            ,(if (string? (car ast))
                 `(let ((x_t_mst:i8* (salloc 1024)))
                    (sprintf x_t_mst "%s" ,(car ast))
                    (String x_t_mst))
                 (list 'toString (car ast)))
            ,@(flatten-1 (map (lambda (x)
                                (if (string? x)
                                    (list `(let ((x_t_mst:i8* (salloc 1024)))
                                             (sprintf x_t_mst " %s" ,x)
                                             (String x_t_mst)))
                                    (list
                                     (list 'toString_space)
                                     (list 'toString x))))
                              (cdr ast))))))))


Back to Index

Similar Entries

  • impc:ti:sprintln2    scheme