zoukankan      html  css  js  c++  java
  • erlang 二进制中 拼接 变量或者函数 报错

    60> AA = "AA".                        
    "AA"
    61> <<AA>>.                           
    ** exception error: bad argument
    62> << list_to_binary(AA)/binary >>.
    * 1: syntax error before: '('
    62> << list_to_binary(AA)/binary >>.
    * 1: syntax error before: '('
    62> << (list_to_binary(AA))/binary >>.
    <<"AA">>
    

    在qq群中咨询得知:

    Value:Size/TypeSpecifierList
    The Value part is any expression, when used in binary construction. Used in binary matching, the Value part must be a literal or a variable

    When constructing binaries, Value and Size can be any Erlang expression. However, for syntactical reasons, both Value and Size must be enclosed in parenthesis if the expression consists of anything more than a single literal or a variable

    在官网中链接:http://www.erlang.org/doc/programming_examples/bit_syntax.html

  • 相关阅读:
    Django url
    Django 命令
    MVC和MTV模式
    pymysql操作
    mysql 基本操作
    jquery基本操作
    外边距内边距
    css
    Html
    __name__ __main__ 作用
  • 原文地址:https://www.cnblogs.com/ribavnu/p/4881464.html
Copyright © 2011-2022 走看看