I am writing a small driver object in Lua for a sensor on a NodeMCU board. I defined function Sensor:read(channel), but when I call mySensor.read(2) I get an error about indexing a number value, while mySensor:read(2) works.
I thought the dot and the colon were two spellings of the same thing. What exactly does the colon do, in the definition and in the call, and when should each be used?




