本文已被:浏览 1452次 下载 2228次
Received:August 21, 2014 Revised:October 08, 2014
Received:August 21, 2014 Revised:October 08, 2014
中文摘要: O'Caml语言是一门优秀的函数式程序语言, 具有计算模型简单、语法语义描述清晰等特点, 而通用编程技术方法通过高度抽象算法、数据结构及其他软件组件可以避免功能相似代码的重复编写. 针对如何将通用编程技术方法和O'Caml语言相结合来提高O'Caml程序复用程度的问题, 通过对O'Caml语言语法进行扩展引入类型标记1函数, 然后运用类型结构化转换和类型映射机制, 实现通用函数, 从而达到在O'Caml语言中引入通用编程技术的目的. 实例结果表明, 在O'Caml语言中实现通用编程技术, 有效提高了编程效率和程序的通用性.
Abstract:O'Caml is a popular functional programming language with a lot of advanced features, such as: simple module, clear grammar and semantci, etc. Generic programming which programs through the abstracting of algorithm, data structure and all other of the software components can avoid the repeated work of coding with similar functions. In order to combine the generic programming and O'Caml language which can improve the reuse of soft, we extend the grammar of O'Caml language to implement type-indexed function, the structure transition and isomorphism of type and generic function. The experimental result shows that the implementation of generic programming in O'Caml language has improved the efficiency and universality of programming.
文章编号: 中图分类号: 文献标志码:
基金项目:
引用文本:
李阳,赵建平,张德华,程小林.基于O'Caml语言的通用编程技术.计算机系统应用,2015,24(5):106-110
LI Yang,ZHAO Jian-Ping,ZHANG De-Hua,CHENG Xiao-Lin.Generic Programming Based on O'Caml Language.COMPUTER SYSTEMS APPLICATIONS,2015,24(5):106-110
李阳,赵建平,张德华,程小林.基于O'Caml语言的通用编程技术.计算机系统应用,2015,24(5):106-110
LI Yang,ZHAO Jian-Ping,ZHANG De-Hua,CHENG Xiao-Lin.Generic Programming Based on O'Caml Language.COMPUTER SYSTEMS APPLICATIONS,2015,24(5):106-110