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.
我有一个 yaws 文件(比如说 a.yaws),里面有很多我一次又一次使用的函数。所以我决定将这些常用函数放在另一个 yaws 文件中(比如说 common.yaws)并包括这偏航到 a.yaws。那么正确的语法是什么。我正在使用它,但似乎不包括文件-include(“common.yaws”)。
提前谢谢。
如果您在公共文件中拥有的函数基本上是 erlang 函数,您可以简单地将这些函数放在一个 erlang 模块中,然后直接调用该函数。举个例子:
(在一个.yaws中)
<erl> out(Arg) -> mycommonstuff:doIt(Arg). </erl>
其中 mycommonstuff.erl 包含导出的函数 doIt。
如果您的 common.yaws 文件实际上包含 yaws 类型的功能,您可以使用 yaws 的服务器端包含功能 - 这在此处进行了解释:
http://yaws.hyber.org/ssi.yaws