@owensd isn't everything pretty much copy by default?
-
-
-
@chrisbrandow everything is a copy, yes. The question is, are you copying a value-type or a reference type? The code site is not clear. - View other replies
-
@chrisbrandow going to the type decl each time to verify is error prone and fragile. I’d like more clarity.
-
-
-
@owensd none of them are reference, both Sets are values, ore immutable and other mutable. Also active verb like "remove" are mutating -
@KostiaKoval@owensd basically what he said. Don’t think about pointers. Think about stuff being inside the variable itself. - View other replies
-
@swizzlr@KostiaKoval yeah, you’ve missed the point. Had that type been MySet, you wouldn’t know unless you went to the type declaration. -
-
@KostiaKoval@owensd@swizzlr maybe different colors for classes and structs can help.pic.twitter.com/WYT0hC15Zs
-
@mustafa_ysf@KostiaKoval@swizzlr that assumes a code editor that can colorize based on those concepts; not all can. -
@owensd@KostiaKoval@swizzlr true but at some point we should use some tools right?
-
-
-
@owensd Is there any language you know of which has explicit differentiation in code between passing by value vs reference? -
@wczekalski any pointer-based language. -
@owensd I always ask you dumb questions
-
-
-
@owensd agree, but if you make a Set type in Swift with reference semantics you're doing something wrong -
-
-
@owensd I think it's the programmers responsibility to choose names that make it somewhat clear whether it's a struct or a class -
@owensd IOW, even more important than whether there actually was a mutation is the ability to assert that nothing has changed. -
@owensd …it fires every time. Which makes sense, and sort of helps me think about how swift sees value types.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
David Owens II
christopher
Kostiantyn Koval
Tom Svvizzlr
Mustafa Yusuf
Bader Al-Rasheed
Wojtek Czekalski
Javi
Marcel Weiher
Kametrixom
Jed Lewison