[plt-scheme] here-string
David J. Neu wrote:
> Bruce,
>
> Thanks for the reply. As Felix mentions, I was hoping for a more
> WYSIWYG-ish solution where I didn't have to worry about the
> double-quotes.
>
> Either something like the following from the scsh manual:
>
> (run (csh -c #<<EOF
> cd /urops
> rm -rf *
> echo All done.
>
> EOF
> ))
>
> or even something like the following might be OK (but it's probably
> not quite as nice):
>
> (define sh-code-1
> (here-string
> alias modemup='su -c "ifdown eth0;wvdial &"'
> alias modemdown='su -c "killall wvdial;ifup eth0"'))
> =>
> alias modemup='su -c "ifdown eth0;wvdial &"'
> alias modemdown='su -c "killall wvdial;ifup eth0"'
>
> (define sh-code-2
> (format (here-string
> alias ~a='su -c "~a"'
> alias ~a='su -c "~a"')
> "modemup"
> "ifdown eth0;wvdial &"
> "modemdown"
> "killall wvdial;ifup eth0"))
>
> --David
OK lets look at bar delimited symbols then. I just read about this.
(display
(symbol->string
'|alias modemup='su -c "ifdown eth0;wvdial &"'
alias modemdown='su -c "killall wvdial;ifup eth0"'|))
=>
alias modemup='su -c "ifdown eth0;wvdial &"'
alias modemdown='su -c "killall wvdial;ifup eth0"'
-- Bruce