记录
语法:
-record(Name, {
Key1 = Default1,
Key2 = Default2,
...
Key3,
...
}).
Name记录名,Key1,Key2字段名
创建记录
-record(state, {io, client})
State = #state{}.
提取字段值
1 模式匹配
#state{io = IO} = State.
2 点语法
IO = State#state.io
-record(task,{name,content}).
#record.name 返回name 的索引,2
State#record.name 返回State变量中name字段的值
最是那一低头的温柔,恰似水莲花不胜凉风的娇羞,
道一声珍重,道一声珍重,那一声珍重里有无数甜蜜的忧愁

浙公网安备 33010602011771号