# : operator

Source: https://ref.dm-lang.org/operator/colon

This is the runtime search operator. It is used to access a property (var or proc) of a var that is not explicitly prototyped. If the variable doesn't have the specified variable or proc, a runtime error occurs.

```dm
var/M
M = usr
M:name = "futz"  // access a mob property from a non-mob var
```

The `.` operator behaves the same way, but it checks at compile time whether the property is available. If the var is assigned a value that isn't the correct type and doesn't have this property, a runtime error will still occur.

> [!note]
> 
> You should prefer the `.` operator in most situations, because it's better to catch a problem in the compiler instead of at runtime.

### See also
- [. operator](https://ref.dm-lang.org/operator/dot.md)
- [?. operator](https://ref.dm-lang.org/operator/querydot.md)
- [?: operator](https://ref.dm-lang.org/operator/querycolon.md)
- [: path operator](https://ref.dm-lang.org/operator/path/colon.md)
- [operators](https://ref.dm-lang.org/operator/index.md)
