lua-users home
lua-l archive

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

> True, but I'm thinking of the common operation of creating a new list
> by prepending an element.  It would certainly generate a lot of
> temporaries if you were using Lua tables!   Lua strings are immutable,
> but we quickly learn to build them using tables, not concatenation.

Indeed, thats why I wrote "by default". Clojure for example allows you
to have short-timed mutable datastructures for performance cases like
this. In a functional language misuse of these is hindered by now
allowing you to store them anywhere but the stack. In an imperative,
it would might just be bad style to put a mutable table into a global