【发布时间】:2021-03-02 17:41:22
【问题描述】:
1> Band = band.
* 1: syntax error before: 'band'
我正在尝试在这里创建一个原子,但出现语法错误。为什么?
【问题讨论】:
标签: erlang syntax-error reserved-words
1> Band = band.
* 1: syntax error before: 'band'
我正在尝试在这里创建一个原子,但出现语法错误。为什么?
【问题讨论】:
标签: erlang syntax-error reserved-words
编译器错误并不清楚,但你得到了,但这是由于你使用了一个保留字。有一个complete list here。
andalso 之后 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse query receive rem try when xor
band 是“二进制与”的运算符。
对于不能直接使用的原子,可以使用单引号。
1> Band = 'band'.
'band'
【讨论】: