<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sun May 19 18:56:07 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-714/CLJ-714.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-714] Real multi-line comments</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-714</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;The (comment) macro is not a viable substitute for real multi-line comments:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;It evaluates to nil, so isn&apos;t really useful except at the top level&lt;/li&gt;
	&lt;li&gt;It requires proper paren/etc nesting inside itself&lt;/li&gt;
	&lt;li&gt;Contents must be valid tokens; for example TODO: is illegal inside a (comment)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Common Lisp has #|...|# for multi-line comments, and I think Clojure would benefit from having them too. I&apos;ve implemented #| to behave in a way that is identical (so far as I am able to test) to CL&apos;s implementation, and added tests to the reader test to verify that they work.&lt;/p&gt;

&lt;p&gt;Apologies for my formatting in the java files not quite matching up with the rest of the code: I didn&apos;t want to go through the pain of making it perfect unless this patch would actually be accepted; I can go back through if necessary.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14323">CLJ-714</key>
            <summary>Real multi-line comments</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="2">Declined</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="amalloy">Alan Malloy</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Jan 2011 23:53:50 -0600</created>
                <updated>Sat, 3 Sep 2011 22:05:50 -0500</updated>
                    <resolved>Sat, 3 Sep 2011 22:05:50 -0500</resolved>
                                                                    <due></due>
                    <votes>5</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="26116" author="anthonysimpson" created="Tue, 11 Jan 2011 23:56:53 -0600"  >&lt;p&gt;I am totally for this. I agree that comment isn&apos;t a valid substitution. comment is useless for a lot of things.&lt;/p&gt;</comment>
                    <comment id="26117" author="bsteuber" created="Thu, 13 Jan 2011 06:09:30 -0600"  >&lt;p&gt;Nice - but are you sure just doing nothing on an unexpected EOF is a good idea?&lt;br/&gt;
I guess it usually means I&apos;ve forgotten the close tag somewhere, so I&apos;d rather be informed about it by an exception. Omitting the |# on purpose just to save two characters seems dirty to me.&lt;/p&gt;</comment>
                    <comment id="26118" author="grkuntzmd" created="Thu, 13 Jan 2011 08:19:45 -0600"  >&lt;p&gt;What about &lt;tt&gt;#_(...)&lt;/tt&gt;?&lt;/p&gt;

&lt;p&gt;I know that the parens have to be balanced, but other than that, doesn&apos;t it do everything else?&lt;/p&gt;</comment>
                    <comment id="26119" author="anthonysimpson" created="Thu, 13 Jan 2011 08:35:11 -0600"  >&lt;p&gt;No.&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;user=&amp;gt; #_(TODO: Hi there!)
java.lang.Exception: Invalid token: TODO:
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then, as you mentioned, we have the paren balance problem. The idea is to have something &lt;b&gt;completely&lt;/b&gt; ignores what is inside of it.&lt;/p&gt;</comment>
                    <comment id="26120" author="amalloy" created="Thu, 13 Jan 2011 13:13:28 -0600"  >&lt;p&gt;Good point, Benjamin. I just assumed most languages didn&apos;t need comments to close nicely, but having tried it out I can&apos;t find a single one that would let me get away with an unclosed multi-line comment.&lt;/p&gt;

&lt;p&gt;Revised patch attached, and using git format-patch now that I know it exists.&lt;/p&gt;</comment>
                    <comment id="26121" author="a_strange_guy" created="Thu, 13 Jan 2011 16:02:03 -0600"  >&lt;p&gt;You can use #_ with string literals already:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;#_&quot;TODO: Hi there!&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The only problem we have is that we don&apos;t have raw strings. I don&apos;t think that we need another litrals for comments.&lt;/p&gt;

&lt;p&gt;And I don&apos;t see any use for multiline comments. In Java etc. you use them to uncomment parts of your program (we have #_ (...) for that) or to document classes &amp;amp; methods (we have docstrings which are superior). If you need multiline comments to explain some part of your code, then you should do something about the code (or use #_ &quot;...&quot; if you are lazy).&lt;/p&gt;</comment>
                    <comment id="26122" author="anthonysimpson" created="Thu, 13 Jan 2011 16:20:01 -0600"  >&lt;p&gt;Except with #_&quot;&quot; you can&apos;t just paste something in there because it has to be escaped properly if it has strings and such embedded in it. &lt;/p&gt;

&lt;p&gt;Sure, we can work around these limitations somewhat. We can pile hacks on hacks to get half-working multiline comments or just add this trivial patch and have real multiline comments like every other language in existence. Just sayin&apos;.&lt;/p&gt;

&lt;p&gt;Multi-line comments aren&apos;t for just explaining bad code. #_ isn&apos;t designed for this and thus is not a solution to this, and marking every line of a prewritten text with ; and/or removing or editing it later is just tedious.&lt;/p&gt;

&lt;p&gt;Curiosity: wouldn&apos;t this be useful for literate programming tools?&lt;/p&gt;</comment>
                    <comment id="26123" author="stu" created="Fri, 14 Jan 2011 07:18:09 -0600"  >&lt;p&gt;Rich: if you are interested in this assign to me and I will screen.&lt;/p&gt;</comment>
                    <comment id="26132" author="a_strange_guy" created="Fri, 14 Jan 2011 23:41:57 -0600"  >&lt;p&gt;Don&apos;t think that this is a pressing issue, because every editor that has support for Clojure (or even just Scheme/CL) has a comment-region feature.&lt;/p&gt;

&lt;p&gt;I would support adding a reader macro for raw strings, because &lt;em&gt;that&lt;/em&gt; is an issue (almost every ns docstring is escaped), and if we had those, then multiline comments would be subsumed by them:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;#_
#[[ ;; lua-like proposal for raw strings

]]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="26133" author="laujensen" created="Sat, 15 Jan 2011 07:26:36 -0600"  >&lt;p&gt;If its a pressing issue or not isn&apos;t really the question is it? &lt;/p&gt;

&lt;p&gt;To me its a straightforward patch which adds functionality currently not found in Clojure and which I personally would label a welcomed addition.&lt;/p&gt;</comment>
                    <comment id="26161" author="chouser@n01se.net" created="Mon, 24 Jan 2011 09:40:35 -0600"  >&lt;p&gt;Sure it adds a feature, but it also adds syntax and complexity to the language.  If the feature it adds doesn&apos;t solve real problems of sufficient importance, it may be a net loss for the language.&lt;/p&gt;

&lt;p&gt;For temporarily commenting out code, #_ and (comment ...) work fine.  For hunks of documentation text, ; or ;; work nicely, especially if you have an ultra-advanced editor like vim to handle your text reformatting.  Is there another use case?&lt;/p&gt;</comment>
                    <comment id="26162" author="fogus" created="Mon, 24 Jan 2011 09:59:33 -0600"  >&lt;p&gt;I&apos;m with Chouser on this.  Additionally, I would add that the description of #_ is &quot;The form following #_ is completely skipped by the reader.&quot;  However, trying something like:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    (defn gimmie-pi []
      #_( TODO: validate the accuracy
                of the return value. )
      3)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;currently throws an exception.  Maybe the form should &lt;b&gt;really&lt;/b&gt; be skipped by the reader and allow free form text?  I don&apos;t know if this is the right answer, but I would feel more comfortable with that than a new reader macro.&lt;/p&gt;</comment>
                    <comment id="26163" author="amalloy" created="Mon, 24 Jan 2011 11:21:03 -0600"  >&lt;p&gt;I don&apos;t think that&apos;s possible, Fogus. If it&apos;s going to skip &quot;a form&quot;, then it has to understand the syntax therein well enough to determine which closing paren matches up.&lt;/p&gt;</comment>
                    <comment id="26164" author="fogus" created="Mon, 24 Jan 2011 11:40:32 -0600"  >&lt;p&gt;&amp;gt; which closing paren matches up&lt;/p&gt;

&lt;p&gt;I&apos;m sorry, I was not clear that I didn&apos;t expect my idea to provide the entire functionality of the proposed #| ... |#.  &lt;/p&gt;

&lt;p&gt;I don&apos;t see the utility in providing a whole new reader macro to allow mismatched embedded parentheses.  I can &lt;b&gt;kinda&lt;/b&gt; see the value in allowing things like `TODO:`, although I would probably just use #_() or comment and just make sure that my embedded comment was not malformed and ; otherwise.&lt;/p&gt;</comment>
                    <comment id="26175" author="richhickey" created="Wed, 26 Jan 2011 07:12:52 -0600"  >&lt;p&gt;I&apos;m opposed. I don&apos;t think the benefit/complexity ratio (especially for tools) is high enough. We&apos;ve done without for quite a while and no one&apos;s caught fire.&lt;/p&gt;</comment>
                    <comment id="26758" author="cemerick" created="Sat, 3 Sep 2011 22:05:50 -0500"  >&lt;p&gt;Closed per request from Alan Malloy.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10079" name="0001-Add-multi-line-comments.diff" size="2004" author="amalloy" created="Thu, 13 Jan 2011 13:16:16 -0600" />
                    <attachment id="10077" name="patch.txt" size="2253" author="amalloy" created="Tue, 11 Jan 2011 23:53:50 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10002">Code and Test</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>
</channel>
</rss>