Skip to main content
 首页 » 编程设计

ocaml中我可以在 OCaml 中进行面向方面的编程吗

2024年11月24日94EasonJim

这个问题是否涉及面很广,我想问一下: 是否可以在 OCaml 语言中实现面向方面编程 (AOP) 功能?

请您参考如下方法:

It is interesting to observe that, in contrast to the traditional concept of crosscutting in the OO setting where aspects typically crosscut several classes, the majority of the applications of aspects in functional programming only involve a single function in the pointcut. We believe the realisation of this difference as concluded by this paper is important to both the functional and AOP commu- nity. There is a pressing need to properly interpret and develop of the concept of ‘crosscutting’ in the functional setting before functional AOP spreads its wings. [emphasis mine]

What Does Aspect-Oriented Programming Mean for Functional Programmers? (PDF)

无论如何,AOP 到 OCaml 或 ML 系统都有直接尝试/翻译。从我的评论来看,我认为这些并不令人信服,并且相信正确使用模块和仿函数可以在很大程度上捕获关注点的划分。这些直接尝试是,