[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Conventional name proposal: merge
- From: Egil Hjelmeland <privat@...>
- Date: Fri, 14 Dec 2012 11:28:51 +0100
Den 2012-12-14 07:19, skrev Dirk Laurie:
merge(...): returns a new table containing all the pairs from all the
tables given as arguments. In particular, if there is only one argument,
returns a shallow copy. In case of duplicate keys, later values
replace earlier ones. Nil arguments are treated as empty tables.
The documentation is much longer than the code!
I like it. Simple, generic, works for both array-like and dict-like tables.
Maybe also merge_rev(...) : Processing (...) backwards, giving
precedence to earlier tables in (...) .