如何在雅司病文件中包含雅司病文件

发布于 2024-07-25 06:30:02 字数 189 浏览 2 评论 0原文

我有一个雅司病文件(比如说 a.yaws),里面有很多我一次又一次使用的函数。所以我决定将这些通用函数放在另一个雅司病文件(比如说 common.yaws)中,并包括这个雅司病变成了a.yaws。 那么正确的语法是什么? 我正在使用它,但似乎不包括该文件 -include("common.yaws").

提前致谢。

i have one yaws file(let say a.yaws) inside that I have a lot of function which i m using again and again .so i have decided to put those common function inside the other yaws file (let say common.yaws) and include this yaws to a.yaws.
so what is the correct syntax for this.
i m using it but seems not including the file
-include("common.yaws").

thanx in adavance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一江春梦 2024-08-01 06:30:02

如果你的公共文件中的函数基本上都是 erlang 函数,你可以简单地将这些函数放入 erlang 模块中,然后直接调用该函数。 举个例子:(

在 one.yaws 中)

<erl>
   out(Arg) ->
    mycommonstuff:doIt(Arg).
</erl>

其中 mycommonstuff.erl 包含导出函数 doIt。

如果您的 common.yaws 文件实际上包含 yaws 类型功能,您可以使用服务器端包含 yaws 功能 - 解释如下:

http://yaws.hyber.org/ssi.yaws

If the functions you have in your common file are basically erlang functions you can simply put those functions in an erlang module and simply call the function directly. As an example:

(in one.yaws)

<erl>
   out(Arg) ->
    mycommonstuff:doIt(Arg).
</erl>

where mycommonstuff.erl contains the exported function doIt.

If your common.yaws file actually contains yaws type features you could use the server side include feature of yaws - that is explained here:

http://yaws.hyber.org/ssi.yaws

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文