Erlang:模块属性 [英] Erlang: module attribute

查看:93
本文介绍了Erlang:模块属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Erlang的新人。
在现有的Erlang项目中找到以下 -module 属性声明:

  -module (mod_name,[Name,Path,Version])。 

这里第二个参数(list [Name,Path,Version])是什么意思? >

我没有在Erlang引用中找到任何信息。

解决方案

这定义了一个参数化的erlang模块 - 您可以使用新的模块实例化,然后在模块中执行代码时访问该新模块传递的参数。



非常简短概述在这里:



http://myotherpants.com/2009/04/parameterized-modules-in-erlang/


I am new to Erlang. Found the following -module attribute declaration in an existing Erlang project:

-module(mod_name, [Name, Path, Version]).

What does mean the second parameter (list [Name, Path, Version]) here?

I haven't found any information in the Erlang reference on it.

解决方案

This defines a parameterised erlang module - one you can "instantiate" with new and then access the parameters passed by that new when executing code in your module.

A very brief overview is here:

http://myotherpants.com/2009/04/parameterized-modules-in-erlang/

这篇关于Erlang:模块属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆