Join Slack
Powered by
Is there anything i can use that is like apply but...
# stdlib
a
asad.awadia
12/05/2019, 8:39 PM
Is there anything i can use that is like apply but doesn’t mutate the original object and instead returns a copy?
r
Ruckus
12/05/2019, 8:44 PM
Not really, as there isn't a universal idea of "copy".
☝️ 1
m
Mike
12/05/2019, 9:05 PM
Only if it's a data class. Then you have the copy function and can used named parameters syntax to replace values in the copy.
r
Ruckus
12/05/2019, 10:01 PM
Even then the signature isn't universal.
2
Views
Open in Slack
Previous
Next