[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string immutability
- From: Fabien <fleutot+lua@...>
- Date: Thu, 2 Jan 2014 11:35:30 +0100
The C "buffer" interface in Lua is designed specifically for this: you can append cheaply in it, and the price to pay is, you lose equality-checks-as-cheap-as-a-pointer-comparison. In practice, if you're not performance-bound, using a list-of-strings as your buffer (instead of a single string) gives good enough results without having to use C. table.concat(), which converts the latter into the former, is very effective (although you often never have to convert you list of strings into a single one)