IRC channel logs

2016-01-31.log

back to list of logs

<Phlogistique>join #wisp
<Phlogistique>oops
<lokli>hello all. how can i reproduce (format #f "~s" "hello") in scheme code without format? Just simple string escaping.
<amz3>lokli: it's not supported
<amz3>what would mean simple string escaping anyway?
<lokli>amz3, exactly what this piece of code does. replace \\ with \\\\, same goes for ". I guess i will just write a manual mapping function
<amz3>sorry I don't understand
<lokli>amz3, here, i wrote simple implementation: http://ix.io/o1s
<lokli>turns out is is way easier: (call-with-output-string (lambda (p) (write "hello\\n\\a\\b\\fworld\\n" p)))
***_hanhart_ is now known as _hanhart
<mark_weaver>lokli: good, you found the answer yourself, using 'call-with-output-string' and 'write'.
<lokli>mark_weaver, thanks. i am trying to write code, that can be portable across implementations. Dont know how to go around different modules conventions. Can you please give me any pointers?
<mark_weaver>lokli: guile supports R6RS, so you could use that.
<lokli>mark_weaver, i mean for example match modules. in guile i would put (use-modules (ice-9 match)), but same source would not be understood by other implementations. Is there any way around it?
<mark_weaver>another option is to use 'cond-expand', e.g. see modules/srfi/srfi-64/testing.scm
<mark_weaver>cond-expand is widely supported
<mark_weaver>cond-expand is SRFI-0, described here: http://srfi.schemers.org/srfi-0/srfi-0.html
<lokli>mark_weaver, thanks, that looks like exactly what i need
<mark_weaver>you're welcome!
<jyc>is there some setting I can do to make backtraces more easy to use?
<jyc>for example, right now I am getting this error from somewhere:
<jyc>ERROR: Wrong number of arguments to #<procedure 3059de0 at ice-9/eval.scm:330:13 (a)>
<mark_weaver>jyc: compile your code, and the errors will usually be more helpful
<mark_weaver>the primitive evaluator doesn't do a very good job with error messages.
<mark_weaver>(there's no reason it couldn't, but since we usually compile code there's been less effort spent on it)
<mark_weaver>I have to go afk, sorry.
<jyc>mark_weaver: Cool, just tried that and it works a lot better. Thanks again for the help
<mark_weaver>np!
<zacts>hi guilers
***siel_ is now known as siel