Re:Functional programming is finally going mainstream
by Akronymus on Wednesday July 13, 2022 @09:21AM
(#32082295)
> What you're referring to is more of what happens when someone is writing functional code in a language that's not functional.
And even then, there is the question of whethwr it is a deep or shallow copy on receiving or write.
Re:Functional programming is finally going mainstream
by deltaonenine on Wednesday July 13, 2022 @02:03PM
(#32086453)
just pass a const reference. It's immutable anyway.
This is categorically wrong. You actually don't know what you're talking about.
In an functional programming language, because everything is immutable, the compiler just MOVES everything around. There is ZERO copying in a functional programming language. In fact there's no explicit command for it either. There is zero reason for you to copy a variable that is immutable so there's no copy() function.
What you're referring to is more of what happens when someone is writing functional code in a language that's not functional.