[CM] Scheme S7 convert float to string

Halim Beere halimbeere at gmail.com
Thu Jan 2 11:30:18 PST 2014


I think you need to use (number->string . . . ) to make this work.


On Thu, Jan 2, 2014 at 12:46 PM, James Hearon <j_hearon at hotmail.com> wrote:

> Hi,
> I'm a bit stuck on finding info for scheme s7 format conversion from float
> to string for output to file.  I've tried several things, mostly looking at
> lisp code, but cannot seem to come up with what it wants.  Any help or
> hints would be appreciated.
>
> Thank you.
>
>
> (define ouf1 (open-output-file "myfloats.txt"))
> (define outstring "init")
>
> (define (myfloats total)
> (let ((test 0))
>  (process  with mytable = (make-heap '(.5 1 2.5 3))
>       until (= test total)
>       do
> (set! outstring (next mytable))   ;***stuck here with format conversion ***
> (set! outstring (string-append outstring (string #\newline)))
> (display outstring ouf1)
> (print (next mytable))
> (set! test (+ test 1))   )))
>
> (sprout (myfloats 10) )
>
> (close-output-port ouf1)
>
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20140102/bc9e7bfc/attachment.html 


More information about the Cmdist mailing list