lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Luiz Henrique de Figueiredo wrote:
>> Eric, your patch could likely be salvaged if it were to concatenate
>> adjacent strings only when they are preceded by an open parenthesis:
> 
> Yes, but this is not as general as possible, because it'd not work
> 	for things like this: a(1,"x" "y",2)
> 
> You could think that it'd be ok to concatenate adjacent that occur
> 	inside a parenthesis, but that does not work in this case:
a(1,f"x"
> "y") 
> 
>> I think that would be do-able entirely in the lexer
> 
> So, no, I don't think it's possible. The only way out seems to me to
> 	add a lex-time string concatenation operator, say &: a(1,f"x" &
"y")
> 
> But I find & heavy and ugly. I find* (· in HTML) much nicer,
> but it is harder to type. --lhf

The tilde of inequality operator is already painful to type on a french
keyboard, but the middot is not there at all. Wouldn't a single normal
dot do the job ?

a(1,"x"."y",2)
a(1,f"x"."y")

Or from an earlier mail:

myBigString = "The first part of the string "
            . "is followed by the the second "
            . "part of the string."

That's just a suggestion, I don't think the compile time string concat
feature is necessary. Since there are not that many unused syntax
constructs in Lua's syntax maybe we should spare them for more important
(future) features.