<div class="gmail_quote">On Mon, Dec 3, 2012 at 8:12 AM, Marco Antoniotti <span dir="ltr"><<a href="mailto:antoniotti.marco@disco.unimib.it" target="_blank">antoniotti.marco@disco.unimib.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Dear all,<div><br></div><div>I was fooling around with reader macros to implement some - let's say - "tuple" syntax.</div><div><br></div><div>Now, I am just curious about the general thinking on this.</div>

<div><br></div><div>First of all, let's note that the problem here in the conflating of the "constructor" with the "printed representation" of an item.  I.e., in Matlab you say</div><div><br></div>

<div><font face="Courier">>> [1, 2, 40 + 2]</font></div><div><font face="Courier">ans =</font></div><div><font face="Courier"><span style="white-space:pre-wrap">       </span>1<span style="white-space:pre-wrap">       </span>2<span style="white-space:pre-wrap">       </span>42</font></div>

<div><br></div><div><br></div><div>In CL, doing the simple thing, you get</div><div><br></div><div><font face="Courier">cl-prompt> [1 2 (+ 40 2)]</font></div><div><font face="Courier">[1 2 42]</font></div><div><br></div>

<div>but</div><div><br></div><div><font face="Courier">cl-prompt> #(1 2 (+ 40 2))</font></div><div><font face="Courier">#(1 2 (+ 40 2))</font></div><div><br></div><div>So, suppose you have your <font face="Courier">[ … ]</font> reader macro, would you have it work "functionally" or "quoting-ly" (for want of a better word)?  I am curious.  Note that the Matlab-style version would not break referential transparency if you did not have mutations.</div>

</div></blockquote><div> </div><div>I struggled with this very question in Antik (grid syntax with #m).  What I decided was it should mimic CL #(, i.e., not evaluate.  For evaluation, I have function(s), particularly #'grid, so<br>

<br>ANTIK-USER> (setf *default-grid-type* 'foreign-array)<br>FOREIGN-ARRAY<br>ANTIK-USER> (grid 1 2 (+ 40 2))<br>#m(1.000000000000000d0 2.000000000000000d0 42.000000000000000d0)<br><br>(Note #'grid doesn't take as arguments any options like the grid type, just elements, but there are other functions that will.)  My reasoning was mainly to be consistent with CL, but also somehow a reader macro triggering an evaluation seemed wrong; a function was the most appropriate way to do that.  I can't recall right now the problem that caused me to switch (before, it did do evaluation), but it was a mess and this was the easiest way to clean it up.<br>

<br>Liam<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>best</div><div><br></div><div>Marco Antoniotti</div>

<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div>--<br>Marco Antoniotti, Associate Professor<span style="white-space:pre-wrap">                              </span>tel.<span style="white-space:pre-wrap">    </span><a href="tel:%2B39%20-%2002%2064%2048%2079%2001" value="+390264487901" target="_blank">+39 - 02 64 48 79 01</a><br>

DISCo, Università Milano Bicocca U14 2043<span style="white-space:pre-wrap">            </span><a href="http://bimib.disco.unimib.it" target="_blank">http://bimib.disco.unimib.it</a><br>Viale Sarca 336<br>I-20126 Milan (MI) ITALY<br>

<br>Please note that I am not checking my Spam-box anymore.<br>Please do not forward this email without asking me first.<br><br><br><br><br></div><br></div></div><br>_______________________________________________<br>
pro mailing list<br>
<a href="mailto:pro@common-lisp.net">pro@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro</a><br></blockquote></div><br>