<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>You could just call lst with num as a parameter. Or you might be looking for define-syntax not define. Is that possible? </div><div><br></div><br><div><div>On Nov 17, 2012, at 1:05 AM, Monica Tomson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p style="clear:both;vertical-align:baseline;line-height:17.600000381469727px;font-size:13.600000381469727px;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;margin:0px 0px 1em;word-wrap:break-word;border:0px;padding:0px">
Hi,</p><p style="clear:both;vertical-align:baseline;line-height:17.600000381469727px;font-size:13.600000381469727px;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;margin:0px 0px 1em;word-wrap:break-word;border:0px;padding:0px">
I have an experiment for my project, basically, I need to <em style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">embedded</em> some s-expression into the code and make it run, like this,</p>
<pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;line-height:17.600000381469727px"><code style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif"><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">test lst</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">)</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> num </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0);background-repeat:initial initial">1</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">)</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> l </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">list</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">))</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">`@</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">lst</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">)</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:gray;background-repeat:initial initial">; oh, this is not the right way to go.</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> lst
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">`</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> num2 </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">add1 num</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">))</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">displayln num2</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">)))</span></code></pre><p style="clear:both;vertical-align:baseline;line-height:17.600000381469727px;font-size:13.600000381469727px;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;margin:0px 0px 1em;word-wrap:break-word;border:0px;padding:0px">
I want the <code style="margin:0px;padding:1px 5px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-repeat:initial initial">test</code> function be like after <code style="margin:0px;padding:1px 5px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-repeat:initial initial">test(lst)</code> in racket code:</p>
<pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;line-height:17.600000381469727px"><code style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif"><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">test lst</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">)</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> num </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0);background-repeat:initial initial">1</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">)</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> l </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">list</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">))</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139);background-repeat:initial initial">define</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent"> num2 </span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">add1 num</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">)</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent">displayln num2</span><span style="margin:0px;padding:0px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">))</span></code></pre><p style="clear:both;vertical-align:baseline;line-height:17.600000381469727px;font-size:13.600000381469727px;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;margin:0px 0px 1em;word-wrap:break-word;border:0px;padding:0px">
How can I do this in racket?</p><p style="clear:both;vertical-align:baseline;line-height:17.600000381469727px;font-size:13.600000381469727px;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;margin:0px 0px 1em;word-wrap:break-word;border:0px;padding:0px">
Thanks,</p><p style="clear:both;vertical-align:baseline;line-height:17.600000381469727px;font-size:13.600000381469727px;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;margin:0px 0px 1em;word-wrap:break-word;border:0px;padding:0px">
--Monica</p>
____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>