On 1/29/13, David A. Wheeler <dwhee...@dwheeler.com> wrote: > The current testsuite says that in sweet-expressions the following should > mean "(foo (a b) . c)": > foo > ! a b > ! . > ! c > > SHOULD it mean that? My ANTLR BNF doesn't do that, it just treats lone "." > as a period, but we *did* support that previously. >
*shrug* I think it's bad style either way (either you use "," as a symbol, or you use improper lists to structure what is code or code-like). So either way will do. Can even be "unspecified" as far as I'm concerned. "." as symbol is not a good idea in general in Lisps, and improper lists in code-like structures is almost as bad. > It also has said that lone abbreviation on a line, followed by an indent, > applies that abbreviation to the body. E.G., this would mean "(quote (aaa > bbb))": > ' > ! (aaa bbb) > > Again, my ANTLR BNF doesn't do that, but we used to. This one is debatable, > since you can get the same effect with the word "quote" in Scheme (though > that reasoning doesn't apply to Common Lisp). It might be *clearer* for the user to write that, in some contexts. So I think we should support this one at least. > > I've tweaked the ANTLR BNF so that initially-indented special comments are > consumed, with the following hspace consumed too, and then recurses back to > the t_expr production, like this: > | (FF | VT)+ EOL retry2=t_expr {$v=$retry2.v;} > | (initial_indent_no_bang | hspace+ ) > (n_expr {$v = $n_expr.v;} /* indent processing disabled */ > + | scomment hspace* sretry=t_expr {$v=$sretry.v;} > | comment_eol retry3=t_expr {$v=$retry3.v;} ) > | initial_indent_with_bang error > | EOF {generate_eof();} /* End of file */ > This is so that initially-indented block comments don't quietly disable > sweet-expressions in the next line, like this: > #| Hello |# > foo bar > I think should be "(foo bar)" not "foo" then "bar". I vaguely remember hacking this change in the previous version (which is why there's a second entry point for sweet-read). Or maybe something else, don't remember well. Sincerely, AmkG ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss