进口说明
Annotated imports
摘要:
介绍了与import语句相关的scala语言的简单扩展:导出的import,它提供了以可组合的形式重用import子句序列的能力,以及默认重写器,它提供了整个编译单元的基于宏的可插入AST转换机制,通过导入库对象激活。使用这些工具不仅允许更紧凑的代码,它还可以防止应用程序员产生某些类型的错误,并允许在标准编译器上实现本地语言扩展作为库。部分讨论的扩展作为pre-sip \cite{ai-presip}提交给scala语言委员会,可以作为scala语言未来版本中改进导入语义的第一步。
英文摘要:
Presented simple extensions to scala language related to import statements: exported imports, which provide ability to reuse sequence of import clauses in composable form and default rewriters, which provide mechanism for pluggable macro-based AST transformation of overall compilation unit, activated by import of library object. Using these facilities not only allows more compact code, it prevents application programmer from producing certain type of errors too and allows to implement local language extension as libraries on top of standard compiler. Part of discussed extensions is submitted to scala language committee as pre-sip \cite{ai-presip} and can be used as first step for refining imports semantics in the future version of scala language.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。