Yes, I'm calling Gambit-C from Python and would like to make this cleaner. Instead of having to do something like:
gambit.eval ("(print \"Hello\n\")") I want to do this: gambit.eval (print "Hello\n") so that the expression following gambit.eval is a standard scheme expression. On Thu, Jan 6, 2011 at 11:34 AM, Jean-Michel Pichavant <jeanmic...@sequans.com> wrote: > David wrote: >> >> 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 >> > > Are you talking about python ?? > > fun( ( + 1 2 ) ) > File "<stdin>", line 1 > fun( ( + 1 2 ) ) > ^ > SyntaxError: invalid syntax > > -- http://mail.python.org/mailman/listinfo/python-list