Ad hoc polymorphism (original) (raw)

About DBpedia

特设多态(ad hoc polymorphism)是程序设计语言的一种多态,多态函数有多个不同的实现,依赖于其实参而调用相应版本的函数。因此,特设多态仅支持有限数量的不同类型。函数重载乃至运算符重载也是特设多态的一种。

Property Value
dbo:abstract En els llenguatges de programació, un polimorfisme ad hoc és un tipus de polimorfisme en el qual les funcions polimòrfiques es poden aplicar a diferents tipus d'arguments. Una funció polimòrfica pot tenir diverses implementacions diferents i potencialment heterogenis depenent del tipus d'arguments als quals s'aplica. En el polimorfisme ad-hoccal que s'especifiqui quins tipus de dades es poden usar. Això està en contrast amb el polimorfisme paramètric (també anomenat genericitat), en el qual les funcions polimòrfiques s'escriuen sense la menció de qualsevol tipus específic, i per tant pot aplicar una única implementació abstracta a qualsevol nombre de tipus d'una manera transparent. Aquesta classificació va ser introduïda per Christopher Strachey en 1967. El polimorfisme ad-hoc s'aconsegueix gràcies al: subtipatge, sobreescriptura i sobrecàrrega de mètodes i lligam dinàmic missatge-mètode. (ca) In programming languages, ad hoc polymorphism is a kind of polymorphism in which polymorphic functions can be applied to arguments of different types, because a polymorphic function can denote a number of distinct and potentially heterogeneous implementations depending on the type of argument(s) to which it is applied. When applied to object-oriented or procedural concepts, it is also known as function overloading or operator overloading. The term ad hoc in this context is not intended to be pejorative; it refers simply to the fact that this type of polymorphism is not a fundamental feature of the type system. This is in contrast to parametric polymorphism, in which polymorphic functions are written without mention of any specific type, and can thus apply a single abstract implementation to any number of types in a transparent way. This classification was introduced by Christopher Strachey in 1967. (en) Ad hoc поліморфізм — один із видів поліморфізму у програмуванні, коли функції з однаковою назвою реалізовують схожу логіку для різних типів вхідних параметрів. Ad hoc поліморфізм підтримується у багатьох мовах через перевантаження функцій та перевантаження операторів. Термін ad hoc використовується, щоб відрізнити цей вид поліморфізму від , у якому логіка функції пишеться тільки один раз і без знання типів, які будуть із нею використовуватись. Ad hoc поліморфізм може доповнювати параметричний поліморфізм, коли для деяких типів потрібна окрема реалізація. Це допомагає вирішити проблеми загального алгоритму, але може порушити узгодженість коду. В С++ така суміш можлива при * спеціалізації шаблону функції чи класу, * частковій спеціалізації шаблону класу. (uk) 特设多态(ad hoc polymorphism)是程序设计语言的一种多态,多态函数有多个不同的实现,依赖于其实参而调用相应版本的函数。因此,特设多态仅支持有限数量的不同类型。函数重载乃至运算符重载也是特设多态的一种。 (zh)
dbo:wikiPageID 390418 (xsd:integer)
dbo:wikiPageLength 7316 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID 1092880989 (xsd:integer)
dbo:wikiPageWikiLink dbr:Programming_languages dbr:Dynamic_dispatch dbr:Interpreter_(computing) dbr:Compiler dbr:Concatenation dbr:Object-oriented_programming dbr:Christopher_Strachey dbr:Function_overloading dbr:Smalltalk dbr:Operator_overloading dbr:Parametric_polymorphism dbr:Polymorphism_(computer_science) dbr:String_(computer_science) dbr:Ad_hoc dbc:Polymorphism_(computer_science) dbr:Type_coercion dbr:Type_system dbr:Late_binding dbr:Floating_point dbr:Type_class dbc:Programming_language_topics dbc:Type_theory dbr:Integer dbr:Integer_(computer_science) dbr:Newspeak_(programming_language) dbr:Object-oriented dbr:Operator_(programming) dbr:Real_number dbr:Self_(programming_language) dbr:List_(computing) dbr:Reflection_(computer_science) dbr:Literal_string dbr:Overloading_(programming) dbr:Subtyping_polymorphism dbr:Type_promotion
dbp:wikiPageUsesTemplate dbt:Reflist dbt:Short_description dbt:Polymorphism
dct:subject dbc:Polymorphism_(computer_science) dbc:Programming_language_topics dbc:Type_theory
gold:hypernym dbr:Kind
rdf:type yago:Abstraction100002137 yago:Communication100033020 yago:Message106598915 yago:Subject106599788 yago:WikicatProgrammingLanguageTopics
rdfs:comment 特设多态(ad hoc polymorphism)是程序设计语言的一种多态,多态函数有多个不同的实现,依赖于其实参而调用相应版本的函数。因此,特设多态仅支持有限数量的不同类型。函数重载乃至运算符重载也是特设多态的一种。 (zh) En els llenguatges de programació, un polimorfisme ad hoc és un tipus de polimorfisme en el qual les funcions polimòrfiques es poden aplicar a diferents tipus d'arguments. Una funció polimòrfica pot tenir diverses implementacions diferents i potencialment heterogenis depenent del tipus d'arguments als quals s'aplica. En el polimorfisme ad-hoccal que s'especifiqui quins tipus de dades es poden usar. Això està en contrast amb el polimorfisme paramètric (també anomenat genericitat), en el qual les funcions polimòrfiques s'escriuen sense la menció de qualsevol tipus específic, i per tant pot aplicar una única implementació abstracta a qualsevol nombre de tipus d'una manera transparent. Aquesta classificació va ser introduïda per Christopher Strachey en 1967. (ca) In programming languages, ad hoc polymorphism is a kind of polymorphism in which polymorphic functions can be applied to arguments of different types, because a polymorphic function can denote a number of distinct and potentially heterogeneous implementations depending on the type of argument(s) to which it is applied. When applied to object-oriented or procedural concepts, it is also known as function overloading or operator overloading. The term ad hoc in this context is not intended to be pejorative; it refers simply to the fact that this type of polymorphism is not a fundamental feature of the type system. This is in contrast to parametric polymorphism, in which polymorphic functions are written without mention of any specific type, and can thus apply a single abstract implementation t (en) Ad hoc поліморфізм — один із видів поліморфізму у програмуванні, коли функції з однаковою назвою реалізовують схожу логіку для різних типів вхідних параметрів. Ad hoc поліморфізм підтримується у багатьох мовах через перевантаження функцій та перевантаження операторів. Термін ad hoc використовується, щоб відрізнити цей вид поліморфізму від , у якому логіка функції пишеться тільки один раз і без знання типів, які будуть із нею використовуватись. В С++ така суміш можлива при * спеціалізації шаблону функції чи класу, * частковій спеціалізації шаблону класу. (uk)
rdfs:label Polimorfisme ad hoc (ca) Ad hoc polymorphism (en) Ad-hoc-полиморфизм (ru) Ad hoc поліморфізм (uk) 特设多态 (zh)
owl:sameAs freebase:Ad hoc polymorphism yago-res:Ad hoc polymorphism wikidata:Ad hoc polymorphism dbpedia-ca:Ad hoc polymorphism dbpedia-ru:Ad hoc polymorphism dbpedia-uk:Ad hoc polymorphism dbpedia-zh:Ad hoc polymorphism https://global.dbpedia.org/id/4LHck
prov:wasDerivedFrom wikipedia-en:Ad_hoc_polymorphism?oldid=1092880989&ns=0
foaf:isPrimaryTopicOf wikipedia-en:Ad_hoc_polymorphism
is dbo:wikiPageDisambiguates of dbr:Polymorphism
is dbo:wikiPageRedirects of dbr:Ad-hoc_polymorphism dbr:Adhoc_polymorphism
is dbo:wikiPageWikiLink of dbr:Intersection_type dbr:Intersection_type_discipline dbr:Rust_(programming_language) dbr:Fundamental_Concepts_in_Programming_Languages dbr:Operator_overloading dbr:Parametric_polymorphism dbr:Polymorphism dbr:Polymorphism_(computer_science) dbr:Programming_language_theory dbr:C++ dbr:Type_class dbr:Hindley–Milner_type_system dbr:Ad-hoc_polymorphism dbr:Adhoc_polymorphism dbr:Parametricity
is foaf:primaryTopic of wikipedia-en:Ad_hoc_polymorphism