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. 2. ZooKeeper的ZAB协议。

    转自:https://blog.csdn.net/en_joker/article/details/78662880 ZooKeeper并没有完全采用Paxos算法,而是使用了一种称为ZooKeepe ...

  2. 关于程序中delay函数带来的繁琐问题

    导致“滴滴”声音不准确的原因是因为,串口屏幕发送信息的时候会有delay() 的延迟. 得到的教训就是,无论在什么地方,最好都不要加delay的延迟.否则含有delay的子 函数加入到其他模块中,就会 ...

  3. 6. MongoDB

    https://www.mongodb.com/ https://pan.baidu.com/s/1mhPejwO#list/path=%2F 安装MongoDB# 安装MongoDB http:// ...

  4. 利用mysql5.6 的st_distance 实现按照距离远近排序。 (转载)

    http://blog.csdn.net/zhouzhiwengang/article/details/53612481

  5. c++ builder firemonkey 实现填充椭圆

    相信同类Delphi 类似文章非常多了,这里我用c++ builder firemonkey 实现填充椭圆 本例主要在FormPaint实现,当然你想在Image1->Bitmap->Ca ...

  6. 关于python中矩阵的实现和矩阵的转置

    python中矩阵的实现是靠序列,,, 序列有很多形式, 其实矩阵是现实生活中的东西,把现实生活中的结构转换到程序中. 就需要有个实现的方法,而这种路径是多种多样的. 下面给出一个把矩阵转换成pyth ...

  7. vue项目在其他电脑运行报错

    解决方法1.先删除node_modules文件夹2.$ cnpm cache clean 命令清除掉cache缓存3.cnpm install4.npm run dev

  8. cookie和session使用

    cookie和session使用 一.总结 1.需要使用的场景:验证用户是否登录时    获取用户的用户名时  退出登录时 2.cookie和session在什么时候记录:在登录成功之后 二.cook ...

  9. 使用四种框架分别实现百万websocket常连接的服务器--转

    原文地址:http://colobu.com/2015/05/22/implement-C1000K-servers-by-spray-netty-undertow-and-node-js/#Nett ...

  10. LA 2191 - Potentiometers

    看题传送门 Fenwick树的应用~~~ #include <cstdio> #include <cstring> #include<algorithm> usin ...