<br><br><div class="gmail_quote">On Nov 26, 2007 8:56 PM, Matthew Flatt &lt;<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br></div>Well, one more example:<br><div class="Ih2E3d"><br> &nbsp;(define code-test #&#39;(code &quot;DrScheme&quot; &quot;DrScheme&quot;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;DrScheme&quot; (break one) (break two) &quot;DrScheme&quot;
<br></div><div class="Ih2E3d"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(break three) &quot;DrScheme&quot;))<br><br> &nbsp;(slide/center<br> &nbsp; (code #,code-test))<br><br></div>This example will format the way you wanted; I changed the `quote&#39; to a
<br>`quote-syntax&#39;, and source information is preserved with the syntax<br>object.<br></blockquote><div><br>&nbsp; Thanks! I get your meaning.&nbsp; Many of my sexp are composed in a way like<br><br>(define w-prog1 `(int w-test (,arg1) &quot;{&quot; (,d1 ,d2) &quot;;;&quot; ,w-prog1-s &quot;}&quot;))
<br><br>It&#39;s a trial to change all the definitions, but I get the idea now.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br></div>I always just select a range of text in DrScheme and hit Tab to<br>reformat it. If new line breaks are needed to make the layout better, I<br>put them in manually.<br><div><div></div></div></blockquote>
<div><br>You missed my problem. I use scheme to modify scheme code, not manually<br><br>here is the code<br><br>(module subst mzscheme<br>&nbsp; (require (lib &quot;file.ss&quot;))<br>&nbsp; (require (lib &quot;pretty.ss&quot;))<br>
&nbsp; <br>&nbsp; (define (sub before after source target)<br>&nbsp;&nbsp;&nbsp; (let ([v ()])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (call-with-input-file source<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (lambda (iport)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (set! v (read iport))))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (call-with-output-file target<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (lambda (oport)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (pretty-print (tsub before after v) oport))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;truncate)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>&nbsp; <br>&nbsp; (define (tsub origin after v)<br>&nbsp;&nbsp;&nbsp; (if (list? v)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (map (lambda (x)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (tsub origin after x)) v)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if (equal? origin v)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; after<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v)))<br>)<br><br>the problem here is&nbsp; when scheme &quot;read iport&quot;, the comment is discarded, only essential things are read.<br><br>If I use (read-line port), it&#39;s a complexed case analysis on the source file. So ...
<br><br><br></div></div><br clear="all">Gang