Module
 
-module(Name).
模块是方法的集合。注意这行最后的“.”符号是必不可少的。
这个模块名必须和保存这段代码的文件(后缀为“erl”的文件)有相同的名称。
当我们在使用另一个模块中的函数时,我们使用下面的语法module_name:function_name(arguments).
在模块中的注释用“%”表示,一直到这一行的结束。
 
-Tag(Value).
模块中包括一系列的属性列表。
属性可以用Module:module_info(attributes)或者beam_lib(3)得到。
 
-compiled(export_all).
-export([Function/Arity,...]).
-import(Module,[function/Arity,...]).
-author(Name).
-date(Date).
-behaviour(Behaviour).
-record(Name, Field).
-vsn(Version).
-include("SomeFile.hrl").
-define(Macro,Replacement).
-file(File, Line).
-type my_type() :: atom() | integer().
   自定义类型特别是在record中有助于进行类型检查
-spec my_function(integer()) -> integer().
   对于方法的参数和返回值进行类型的定义,用以TypEr进行类型的检查。
 
 
module_loaded(Module) -> bool()
   判断模块是否被装载。(并不会试图装载模块)。
%% This BIF is intended for the code server (see code(3)) and should not be used elsewhere.
 
=============================================================
Function
 
函数的返回值是最后一个表达式执行的结果
=============================================================

Erlang Module and Function的更多相关文章

  1. Python: import vs from (module) import function(class) 的理解

    Python: Import vs From (module) import function(class) 本文涉及的 Python 基本概念: Module Class import from . ...

  2. ImportError: dynamic module does not define module export function (PyInit__sqlite3)

    使用python3.6 中的django-admin创建项目的时候报错 ImportError: dynamic module does not define module export functi ...

  3. 编译caffe的Python借口,提示:ImportError: dynamic module does not define module export function (PyInit__caffe)

    >>> import caffeTraceback (most recent call last): File "<stdin>", line 1, ...

  4. Use Module and Function instead of Class in Python

    The following scripts run in ipython demonstrate the differences between instance method and static ...

  5. ImportError: dynamic module does not define module export function (PyInit__caffe)

    使用python3运行caffe,报了该错误. 参考网址:https://stackoverflow.com/questions/34295136/importerror-dynamic-module ...

  6. Erlang第三课 ---- 创建和使用module

    ----------------小技巧----------------------------- 因为这一课开始,我们要使用Erlang文件操作,所以,我们期待启动shell的时候,当前目录最好是是我 ...

  7. function module 之间调用

    1: 在一个function group 中定义一个function module 2:在另外一个module中调用该module "调用其它function 要用 单引号 引着. 一个mo ...

  8. pytest fixture中scope试验,包含function、module、class、session、package

    上图是试验的目录结构 conftest.py:存放pytest fixture的文件 import uuid import pytest @pytest.fixture(scope="mod ...

  9. [Erlang 0119] Erlang OTP 源码阅读指引

      上周Erlang讨论群里面提到lists的++实现,争论大多基于猜测,其实打开代码看一下就都明了.贴出代码截图后有同学问这代码是哪里找的?   "代码去哪里找?",关于Erla ...

随机推荐

  1. 开源课程管理系统(CMS):Moodle

    开源课程管理系统(CMS):Moodle 一.总结 1.php开发的cms,可借鉴参考用 二.Moodle(百度) Moodle(Modular Object-Oriented Dynamic Lea ...

  2. amazeui学习笔记一(开始使用3)--兼容性列表compatibility

    amazeui学习笔记一(开始使用3)--兼容性列表compatibility 一.总结 1.不要用ie做前端测试,不要碰ie,尽量用google 浏览器: 按照微软官方的说法,IE 开发者工具中的浏 ...

  3. C# foreach 循环遍历数组

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...

  4. JQuery源码解析 目录

    1. a.$查询符号就是放在沙盒里面的: window.jQuery = window.$ = jQuery; b.一个jQuery对象无 new 构造: eg: $("#text" ...

  5. JS如何动态生成变量名[重点]

    解决方案: function create_variable(num){           var name = "test_"+num;   //生成函数名           ...

  6. a-star算法

    http://blog.csdn.net/shanshanpt/article/details/8977512 这篇文章讲得不错. 所谓的启发函数,所谓权值之类(此处所谓的权值就是路劲的长度).YES ...

  7. java中那些已经有的好用轮子

    后续补充 IOUtils http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/IOUtils.html ...

  8. SQL Server2008 Hierarchyid数据类型

    以往我们在关系数据库中建立树状结构的时候,通常使用ID+ParentID来实现两条 纪录间的父子关系.但这种方式只能标示其相对位置.解决这类问题在SqlServer2005出现之前通常是采用游标来操作 ...

  9. vim编辑器经常使用命令

    高级一些的编辑器,都会包括宏功能,vim当然不能缺少了.在vim中使用宏是很方便的: :qx     開始记录宏,并将结果存入寄存器xq     退出记录模式@x     播放记录在x寄存器中的宏命令 ...

  10. 【习题5-4 UVA-10763】Foreign Exchange

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 如果x>y 则num[(x,y)]--; 否则num[(x,y)]++; 看看每一个二元组的num值是不是都为0就好. [代码 ...