In which language did exceptions first appear?

空扰寡人 提交于 2019-12-23 12:28:53

问题


I first came across exceptions with ADA 83. As far as I know, the designers of ADA invented the concept of exceptions. Is this true, or did any programming language that came before use exceptions too?


回答1:


According to c2.com's Ground Breaking Languages page it was PL/I.




回答2:


It depends on how you define generics. Parametric polymorphism - which allows you to define functions and types that are not tied to particular argument / field types - was there in ML already - and that's 1973. There is a Standard ML sample from Wikipedia:

fun reverse [] = []
  | reverse (x::xs) = (reverse xs) @ [x]

Note that this function is statically typed, but polymorphic ("generic") on any type of list.

While this example is SML (which is a later thing), so far as I know, the concept was present in earliest ML versions as well.




回答3:


From Wikipedia:

Generic programming facilities first appeared in the 1970s in languages like CLU and Ada, and were subsequently adopted by many object-based and object-oriented languages, including BETA, C++, D, Eiffel, Java, and DEC's now defunct Trellis-Owl language. Implementations of generics in languages such as Java and C# are formally based on the notion of parametricity, due to John C. Reynolds.



来源:https://stackoverflow.com/questions/1308434/in-which-language-did-exceptions-first-appear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!