Typedef - Other Languages

Other Languages

In many statically typed functional languages, like Haskell, Miranda, OCaml, etc., one can define type synonyms, which are the same as typedefs in C. An example in Haskell:

type PairOfInts = (Int, Int)

This example has defined a type synonym PairOfInts which means the same as a pair of Ints.

C# also contains a feature which is similar to the typedef of C; however, it must be redeclared for each separate file.

using newType = global::System.Runtime.Interop.Marshal; using otherType = Enums.MyEnumType; using StringListMap = System.Collections.Generic.Dictionary>;

Read more about this topic:  Typedef

Famous quotes containing the word languages:

    No doubt, to a man of sense, travel offers advantages. As many languages as he has, as many friends, as many arts and trades, so many times is he a man. A foreign country is a point of comparison, wherefrom to judge his own.
    Ralph Waldo Emerson (1803–1882)

    The less sophisticated of my forbears avoided foreigners at all costs, for the very good reason that, in their circles, speaking in tongues was commonly a prelude to snake handling. The more tolerant among us regarded foreign languages as a kind of speech impediment that could be overcome by willpower.
    Barbara Ehrenreich (b. 1941)