Generic function

Generic function

In certain systems for object-oriented programming such as the Common Lisp Object System and Dylan, a generic function is an entity made up of all methods having the same name.

Generic functions correspond roughly to what Smalltalk calls messages; but when a generic function is called, method dispatch occurs on the basis of all arguments, not just a single privileged one. See under multiple dispatch for more. This is also known as a multimethod.

Another, completely separate definition of generic function is a function that uses parametric polymorphism. This is the definition used when working with a language like OCaml. An example of a generic function isid: a->alet id a = awhich takes an argument of any type and returns something of that same type.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • generic function — daugybinė funkcija statusas T sritis informatika apibrėžtis ↑Funkcija (3), taikoma kelių tipų ↑argumentams, o jos rezultato tipas priklauso nuo argumentų tipų. Pavyzdžiui, skaičiaus modulio funkcija abs(a) yra daugybinė, nes jos argumentas gali… …   Enciklopedinis kompiuterijos žodynas

  • Generic — means pertaining or appropriate to large classes or groups as opposed to specific members of the group. It may refer to:* Generic mood, a grammatical mood used to make generalized statements like Snow is white * Generic antecedents, referents in… …   Wikipedia

  • Function object — A function object, also called a functor or functional, is a computer programming construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax.Function objects are unrelated to functors in… …   Wikipedia

  • Function pointer — A function pointer is a type of pointer in C, C++, D, and other C like programming languages, and Fortran 2003.[1] When dereferenced, a function pointer can be used to invoke a function and pass it arguments just like a normal function. In… …   Wikipedia

  • Generic programming — is a style of computer programming in which algorithms are written in terms of to be specified later types that are then instantiated when needed for specific types provided as parameters and was pioneered by Ada which appeared in 1983. This… …   Wikipedia

  • Generic antecedent — Generic antecedents are representatives of classes, indicated by a reference in ordinary language (most often a pronoun), where gender is typically unknown or irrelevant. [Mark Balhorn, [http://eng.sagepub.com/cgi/content/abstract/32/2/79 The… …   Wikipedia

  • generic — ge·ner·ic /jə ner ik/ adj 1: common or descriptive and not entitled to trademark protection: nonproprietary the generic name of a drug 2: having a nonproprietary name generic drugs M …   Law dictionary

  • Generic Routing Encapsulation — (GRE) is a tunneling protocol designed to encapsulate a wide variety of network layer packets inside IP tunneling packets. The original packet is the payload for the final packet. The protocol is used on the Internet to secure virtual private… …   Wikipedia

  • Generic property — In mathematics, properties that hold for typical examples are called generic properties. For instance, a generic property of a class of functions is one that is true of almost all of those functions, as in the statements, A generic polynomial… …   Wikipedia

  • Function field of an algebraic variety — In algebraic geometry, the function field of an algebraic variety V consists of objects which are interpreted as rational functions on V . In complex algebraic geometry these are meromorphic functions and their higher dimensional analogues; in… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”