Deep copy
-
- Manual Inserter
- Posts: 2
- Joined: Tue Dec 08, 2020 4:50 pm
- Contact:
Deep copy
If I use util.table.deepcopy , can I change the parameters and if so, how
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Deep copy
Code: Select all
local new = util.table.deepcopy(data.raw['foo']['bar'])
new. name = 'newname'
new. whatever = 42
data:extend{new}
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.