lua-users home
lua-l archive

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


On 02/09/2012 04:35 AM, Petite Abeille wrote:
> 
> On Feb 9, 2012, at 10:23 AM, rahul sharma wrote:
> 
>> I agree with LHF. I don't want the string to be broken down in output. Only
>> while coding, I want to follow the 80 column format.
> 
> Ah, ok...
> 
> Then simply concatenate your strings:
> 
> print
> (
>   "Case: (Flow_Entry=Nil and direction=SERVER_TO_CLIENT): " ..
>   "Wrong packet received. Flow_entry not there for flow and " ..
>   "packet received from " ..
>   "server." 
> )

I use this construct extremely often, as I think that allowing code lines to
wrap ruins the readability of indentation, but I'm quite disappointed that
the constant expression isn't compile-time evaluated:

luac -l -p -
x = "fff" .. "ggg"

main <stdin:0,0> (5 instructions, 20 bytes at 0x84f230)
0+ params, 2 slots, 0 upvalues, 0 locals, 3 constants, 0 functions
	1	[1]	LOADK    	0 -2	; "fff"
	2	[1]	LOADK    	1 -3	; "ggg"
	3	[1]	CONCAT   	0 0 1
	4	[1]	SETGLOBAL	0 -1	; x
	5	[1]	RETURN   	0 1