That's right. I wonder if there are other places where this<div>refinement should be introduced?<br><br><div class="gmail_quote">On Mon, Jul 12, 2010 at 8:13 AM, Vladimir Sedach <span dir="ltr"><<a href="mailto:vsedach@gmail.com">vsedach@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">So what you're proposing is making the implicit sequence type be (or<br>
array nil), where nil is treated like a zero-length array? I think<br>
that's a good idea, it will make a lot of things simpler.<br>
<br>
Vladimir<br>
<br>
2010/7/12 Daniel Gackle <<a href="mailto:danielgackle@gmail.com">danielgackle@gmail.com</a>>:<br>
<div><div></div><div class="h5">> I don't know if anyone other than us is using PS LOOP, but we use it<br>
> heavily since our application is very loop-intensive. A continual source<br>
> of bugs is looping over a null collection. Say BAR is null. The following<br>
> will crash:<br>
> (ps (loop :for foo :in bar :do (baz foo)))<br>
> ...because the code expands to include (length bar). This is particularly<br>
> annoying if you're running the code in CL as well, where looping over<br>
> a null collection is just fine.<br>
> We've been dealing with this like so:<br>
> (ps (loop :for foo :in (or bar '()) :do (baz foo)))<br>
> ... but this is ugly and more importantly very brittle, since it means<br>
> tracking down every crash case-by-case.<br>
> My question: what does everybody think about making PS LOOP<br>
> accept null collections and just do nothing in that case? Something<br>
> about this bothers me. It goes against the philosophy of PS, which<br>
> declines to pretend that JS arrays are Lisp lists (something I fully agree<br>
> with). But I'm inclined to make an exception in this case because the<br>
> strict approach is so painful. And this of course raises the<br>
> analogous question for any PS versions of MAPCAR, MAPC, etc.<br>
> Daniel<br>
</div></div>> _______________________________________________<br>
> parenscript-devel mailing list<br>
> <a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>
> <a href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>
><br>
><br>
<br>
_______________________________________________<br>
parenscript-devel mailing list<br>
<a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>
</blockquote></div><br></div>