[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: New long strings [was New long comments in 5.1]
- From: "Dan East" <dan@...>
- Date: Mon, 21 Jun 2004 10:59:01 -0400
> Actually, our proposal is for long strings, which happens to
> be used for long comments, too. It does not make sense to
> discuss it in the context of comments. (I am myself very
> happy with one-line comments.) We have two small requirements:
It seems like there are two different issues here. The language
purists are saying that block comments are just long strings at the
parser level, and so the issue is really with the long strings. However
the long string delimiter is particularly poor for comment use, which is
I think where most of the issues are arising.
So I think the real question is why must the two be bound together?
The C++ style comments patch I posted a few days ago shows how simple
the implementation is to handle block comments without having to rely on
the long string parser. The existing --[[ ]] syntax should be retained
for compatibility and for people that like to do this:
MyString =
--[[This used to be
My Long string]]
[[This is my new
long string]]
If the problem is primarily with block comments then perhaps an
additional block comment style should be added. After all there are 3
ways of delimiting a string ('', "", [[]]), so why can't there be an
additional block comment format carefully chosen to conflict as little
as possible with the Lua syntax? Along that line, if there are already
3 ways of enclosing strings, do we really need yet another? I don't see
much simplicity in that.
Finally, if people are finding that they have to copy / paste big
chunks of text directly into their source code, and don't want to worry
about having to escape single and double quotes, then something like
require_text would be a better solution.
MyString=require_text("my text file.txt")
Just a couple more suggestions to consider. :)
Dan East