Types can be used at four places:
An example when querying the short description of an object:
(string)call_other(ob, "short");
When a function is compiled with strict type testing, it can only call other functions that are defined. If they are not yet defined, prototypes can be defined.
string func(int arg);
Note the ';' instead of a body to the function. All arguments must be givenby names, but does not have to have the same names as in the real definition. All types must of course be the same.
There is currently a bug (3.0.36) that recursive calls can not be done if the function is not also defined by a prototype. That is because a function is not really defined until the whole function has been compiled. Don't rely on this behaviour, which will hopefully soon be fixed. A dangerous effect is that it is possible to redefine efun's, and let the new definition call the old before it is replaced. Such code will break sooner or later.
If an efun is to be redefined to get some new enhancements, always define a new with a new name.
There are two kinds of types. Basic types, and special types. There can be at most one basic type, but any number of special types. The strict type checking is only used by the compiler, not by the runtime. Hence, it is actually possible to store a number in a string variable even when strict type checking is enabled.
Why use strict type checking? It is really recommended, because the compiler will find many errors at compile time, which will save a lot of hard work. It is in general much harder to trace an error occuring at run time. I recommend, that when a wizard is having problem with an object and wants help, that he first must make all functions have declared types.
The basic types can be divided in to groups. Those that are referenced by value, and those that are referenced by address. The types int and string are always representing different entities. But the type object is a pointer to an object. If a value of this type is assigned to a variable or passed as argument, they will all point to the same object. The same goes for arrays. That means that if the value of an element in an array is changed, then it can modify all other variables pointing to the same array. Changing the size of the array will always allocate a new one, though. The comparation operator, ==, will compare the actual value for the group of types above. But for arrays and objects, it will simply check if it is the same object (or array). That has the very important implication that the expression ({}) == ({}) will always evaluate to false becaus the array construction operator-pair, ({ }) always generates a new array.
An integer 32 bit number.
A function of this type can be called with a variable number of arguments. Otherwise, the number of arguments is checked, and can generate an error.
Functions, Predefined Functions, for more information.
There is another syntax that will do the same thing: ob->func(args) This will call function func in object ob. This is a much better way to do it.
The re has been a lot of questions why this syntax hasn't been used to allow for accessing variables in other objects. There are some good reasons for that.