硅谷
硅穀
규곡
SILICON VALLEY
2011年
23期
193-194
,共2页
Fortran%90%接口块%c++%面向对象程序设计%函数重载
Fortran%90%接口塊%c++%麵嚮對象程序設計%函數重載
Fortran%90%접구괴%c++%면향대상정서설계%함수중재
Fortran 90%interface%C++%object-oriented programming%function overloading
函数重载是c++语言多态性的重要体现,也是面向对象程序设计的常用方法,Fortran 90不支持面向对象程序设计,但已经具有一些现代语言特征,为模拟面向对象程序设计提供可能,在分析c++函数重载机制的基础上,通过对Fortran 90相关语言元素、工具的探索,提出利用Fortran 90新增加的接口块这一利器模拟c++函数重载的方法,实例运行结果表明,该方法现实可行,从而扩展Fortran 90的应用范围,并为模拟面向对象程序设计提供思路。
函數重載是c++語言多態性的重要體現,也是麵嚮對象程序設計的常用方法,Fortran 90不支持麵嚮對象程序設計,但已經具有一些現代語言特徵,為模擬麵嚮對象程序設計提供可能,在分析c++函數重載機製的基礎上,通過對Fortran 90相關語言元素、工具的探索,提齣利用Fortran 90新增加的接口塊這一利器模擬c++函數重載的方法,實例運行結果錶明,該方法現實可行,從而擴展Fortran 90的應用範圍,併為模擬麵嚮對象程序設計提供思路。
함수중재시c++어언다태성적중요체현,야시면향대상정서설계적상용방법,Fortran 90불지지면향대상정서설계,단이경구유일사현대어언특정,위모의면향대상정서설계제공가능,재분석c++함수중재궤제적기출상,통과대Fortran 90상관어언원소、공구적탐색,제출이용Fortran 90신증가적접구괴저일이기모의c++함수중재적방법,실례운행결과표명,해방법현실가행,종이확전Fortran 90적응용범위,병위모의면향대상정서설계제공사로。
Function overloading is an important embodiment of polymorphism in C++, and a kind of common use for object-oriented programming. Fortran 90 does not support object-oriented programming, but possesses some features of modern computer languages which make it possible to emulate object-oriented programming. With the exploration of some related language elements and tools of Fortran 90, it is put forward that the function overloading mechanism can be emulated indirectly with the new powerful tool of interfaces on the basis of analyzing C++ function overloading. The examples have proved that this method is workable so as to extend the applicable areas of Fortran 90, and provide some ideas to emulate object-oriented programming.