Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
模块的名称很长(它们使导入函数的名称比需要的长三倍),例如:mapconcat看起来Project.Utils.mapconcat有没有办法导入这个函数并使用它而不用模块名称完全限定它?
mapconcat
Project.Utils.mapconcat
你总是可以这样做:
var x = Project.Utils.mapconcat; // now use x in place of mapconcat
PS:可以使用import语句为模块创建别名
import pu = Project.Utils; // now: pu.mapconcat
这是假设 Utils 是一个模块名称(而不是一个类)。