setX: xCoord setY: yCoord setZ: zCoord
x := xCoord.
y := yCoord.
z := zCoord
x: xCoord y: yCoord z: zCoord
^self basicNew setX: xCoord setY: yCoord setZ: zCoord
What's really happening here? Instances are created by sending messages to the class object for a class. So, we want to send a method to the class object Point3D to create a 3D point object. But the x:y:z: class object can't access instance variables, for two reasons. At first, it's because no instance exists. Next, it's because it's not an instance of a 3D point, so it doesn't have any instance variables! So, the only way it can set the coordinates is to ask the newly created instance to set them itself. This is exactly what the setX:setY:setZ: method does; it's "private", though, since it shouldn't generally be used. The @ method you'll define is pretty straightforward, so I won't discuss it here (but make sure to ask questions if you're still confused).
So, the only outstanding question that's confusing is, what's this
^self basicNew setX: xCoord setY: yCoord setZ: zCoord
stuff? Well, self is the Point3D class object (what x:y:z: was sent
to). basicNew creates a new instance of class Point3D, and then the
setX:setY:setZ: initializes the coordinates.