Code inclusion rework #58
标签
未选择里程碑
未指派成员
1 名参与者
通知
到期时间
未设置到期时间。
依赖工单
没有设置依赖项。
参考:aerscript/Aer#58
正在加载...
在新工单中引用
没有提供说明。
删除分支 %!s(<nil>)
删除分支是永久的。虽然已删除的分支在实际被删除前有可能会短时间存在,但这在大多数情况下无法撤销。是否继续?
Actually, we got 2 builtin function: include() and require(). Both of them are available only inside methods body. The proposition is to:
Thus 'include()' would be still a builtin function, while 'require' would become a language construct. Having that, 'include()' should allow to include code several times (i.e. in loop), while require should work as 'require_once'.
Additionally, 'import()' allows to load a shared AerScript module. Actually it is implemented as a built-in function returning TRUE on success, or FALSE otherwise. This gives the control to the software developer on potential fallback or throwing an exception it module is not available, when called from constructor for example. If we decide to rewrite it as language construct it would need to throw exception without ability to catch it from global scope.
Decision? I vote for having 'include()' and 'import()' builtin methods and 'require' language construct.