Convert arbitrary function inputs to string

David dwdreisigmeyer at gmail.com
Thu Jan 6 11:23:49 EST 2011


Hi,

I'd like to have a function that takes arbitrary inputs and returns
them as a single string, with proper escapes for special characters I
can define.  For example:

fun( ( + 1 2 ) )
=> "( + 1 2)"

or

fun(  (define (myhello str) (begin (print (string-append "Hello "
str)) (newline) )) )
=>  "(define (myhello str) (begin (print (string-append \"Hello \"
str)) (newline) ))"

Thanks,

-Dave



More information about the Python-list mailing list