Re: [racket-users] Writing a blank to a file
(with-output-to-string #; "marco.txt" (lambda () (printf " "))) (Replace 'string' with 'file' and delete the comment char #;) On Mar 2, 2016, at 1:12 PM, Marco Morazanwrote: > > Hi All, > > I seem to recall I knew how to do this once, but can't recall the details. > > How do we write a blank to a text file without the parallel bars appearing? > > So, (write '| | outfile) produces | | in the file. I want to eliminate the > vertical bars. > > Thanks, > > Marco > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Writing a blank to a file
Marco Morazan wrote on 03/02/2016 01:12 PM: How do we write a blank to a text file without the parallel bars appearing? So, (write '| | outfile) produces | | in the file. I want to eliminate the vertical bars. That quote and vertical bars are creating an unusual symbol. Do you instead want to write a string or character? (write-string " " outfile) (display " " outfile) (write-char #\space outfile) (display #\space outfile) Neil V. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Writing a blank to a file
On Wednesday, March 2, 2016 at 1:15:30 PM UTC-5, Stephen Chang wrote: > Use display? or set read-accept-bar-quote to #f Thanks! Works like a charm! :-) Marco > > On Wed, Mar 2, 2016 at 1:12 PM, Marco Morazanwrote: > > > > Hi All, > > > > I seem to recall I knew how to do this once, but can't recall the details. > > > > How do we write a blank to a text file without the parallel bars appearing? > > > > So, (write '| | outfile) produces | | in the file. I want to eliminate the > > vertical bars. > > > > Thanks, > > > > Marco > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Racket Users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to racket-users+unsubscr...@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Writing a blank to a file
To clarify what Stephen wrote there a bit, you should probably want to only use `display` here. To a first approximation, `write` is used for writing out values that you can read back in with `read`. (This doesn't work in general and you actually want to make things marshlable if that is your goal, but that's the general idea anyway.) `display` on the other hand, is used for writing out arbitrary text to `current-output-port`. For this reason, I tend to like `printf` and `format` more than `display`. ~Leif Andersen On Wed, Mar 2, 2016 at 1:15 PM, Stephen Changwrote: > Use display? or set read-accept-bar-quote to #f > > On Wed, Mar 2, 2016 at 1:12 PM, Marco Morazan wrote: >> >> Hi All, >> >> I seem to recall I knew how to do this once, but can't recall the details. >> >> How do we write a blank to a text file without the parallel bars appearing? >> >> So, (write '| | outfile) produces | | in the file. I want to eliminate the >> vertical bars. >> >> Thanks, >> >> Marco >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to racket-users+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Writing a blank to a file
Use display? or set read-accept-bar-quote to #f On Wed, Mar 2, 2016 at 1:12 PM, Marco Morazanwrote: > > Hi All, > > I seem to recall I knew how to do this once, but can't recall the details. > > How do we write a blank to a text file without the parallel bars appearing? > > So, (write '| | outfile) produces | | in the file. I want to eliminate the > vertical bars. > > Thanks, > > Marco > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Writing a blank to a file
Hi All, I seem to recall I knew how to do this once, but can't recall the details. How do we write a blank to a text file without the parallel bars appearing? So, (write '| | outfile) produces | | in the file. I want to eliminate the vertical bars. Thanks, Marco -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.