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:

    The very natural tendency to use terms derived from traditional grammar like verb, noun, adjective, passive voice, in describing languages outside of Indo-European is fraught with grave possibilities of misunderstanding.
    Benjamin Lee Whorf (1897–1934)

    Wealth is so much the greatest good that Fortune has to bestow that in the Latin and English languages it has usurped her name.
    William Lamb Melbourne, 2nd Viscount (1779–1848)