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. Android判断App是否在前台运行

    版权声明:本文为博主原创文章,未经博主允许不得转载. //当前应用是否处于前台 private boolean isForeground(Context context) { if (context ...

  2. 3. ZAB与Paxos算法的联系与区别。

    转自:https://blog.csdn.net/en_joker/article/details/78665809 ZAB协议并不是Paxos算法的一个典型实现,在讲解ZAB和Paxos之间的区别之 ...

  3. 学习笔记(二):javascript之dom操作

    一.document.getElementById()    根据Id获取元素节点 <div id="div1"> <p id="p1"> ...

  4. 【河南省多校脸萌第六场 A】分班级

    [链接]点击打开链接 [题意] 在这里写题意 [题解] 最大的给了最小的,实际上就对应了,最大值减1,最小值加1. 那么二分最后班级人数最小的最大可能是几->temp1; 二分最后班级人数最大的 ...

  5. Could not find action or result: There is no Action mapped for namespace [/] and action name [GetG

    Could not find action or result: /car/GetGpsDataAction  There is no Action mapped for namespace [/] ...

  6. 卡塔兰数(Catalan)

    卡塔兰数(Catalan) 原理: 令h(0)=1,h(1)=1. 卡塔兰数满足递推式:h(n)=h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)h(0)(n>=2) ...

  7. Codeforces Round #258 (Div. 2)——B. Sort the Array

    B. Sort the Array time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  8. js进阶 13-1 jquery动画中的显示隐藏函数有哪些

    js进阶 13-1 jquery动画中的显示隐藏函数有哪些 一.总结 一句话总结:show(),hide(),toggle(),这三个. 1.jquery动画中显示隐藏效果函数有哪些? show()h ...

  9. [Nuxt] Load Data from APIs with Nuxt and Vuex

    In a server-rendered application, if you attempt to load data before the page renders and the data f ...

  10. [TypeScript] Sharing Class Behavior with Inheritance in TypeScript

    Typescript classes make inheritance much easier to write and understand. In this lesson we look into ...