Skip to main content
struct

struct

Search complete. 2 mentions across 1 episode found for "struct".

Oct 17, 2026

Paul HegartyHOST
39:43
That's the way reference works, and this is the way your code you're used to writing would work.
Paul HegartyHOST
39:47
But let's see the same thing with structs.
Paul HegartyHOST
39:49
Structs are always copied, and if it's a let, it's immutable.
Paul HegartyHOST
39:52
So here, if I have let house equal big structure, let's say that's a struct, then I say house.floors equals two will actually not even compile if I put it in a let.
Paul HegartyHOST
40:03
See, I let house equal that, house.floors equals two, because let is not mutable.
Paul HegartyHOST
44:16
It's the same pointer, so that is an identity for that thing that lives in the heap.
Paul HegartyHOST
44:21
You know, like in For Each, remember in For Each, we had to do ID self, and we had to kinda s- tell the For Each thing what-- how to identify each of the things in the collection, so it could match them up with the views? Well, when we do a For Each, which is a collection of classes, boy, it's really easy to provide identity there, right? Because classes, very strong identity.
Paul HegartyHOST
44:42
Structs have no sense of identity, zero, at all.

We value your privacy

We use cookies to understand how you use our platform and to improve your experience. Click “Accept All” to consent, or “Decline non-essential” to opt out of non-essential cookies. Read our Privacy Policy.