erlang 二进制中 拼接 变量或者函数 报错

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVsAAACiCAIAAABgR/nfAAAM5ElEQVR4nO2dzZrcKBJF9Zjd/tnOdNmznO62+2n8pjkLe4qUBMENCCSUOmfhT0boEhHALTmlci6//eu/P378eHt7e0zG8sTZsQDchWVaRwCA48ERACCBIwBAAkcAgETGEUqf5+0/6mv72K901bgPEe2Y9Xj6cweYnKIjbPsVNoN3Y5SeIAx9smAE7IoHR4CXZ+sI1R+Y9j6pDCbYyoid5h33rDgBTmflCMuaVb+yIzzk7RG105YdUq7D4gF4GTKO8OvEeidUN4m+k/Xj0cwWD8Dp+Bzh+TZhpeK5R9j/bPf+zPf2Hx0PwMsQ4Aj6ninpG+MOZbZ4AE6n918Nrg0z2w6MjYcbCngB8s8asit7f8q7AXAEgMnhnUUASOAIAJDAEQAggSMAQAJHAIAEjgAACRwBABLqG0rZFqUnj+gBLoT7Lebs5s92zuoAwMxIjhB1DACTI32OwM4HuAk4AgAkHI6w/8ig1A4AF4V7BABI4AgAkMARACDBO4sAkMARACCBIwBAAkcAgMTy+7//xBEA4CfL73/8hSMAwE+WD29/4wgA8JPl49u37LfFZ18u2LT3vIMgDjGoJwBkWT59+Z51hEzXnFO0bTbvJve26yMCwDPLp6/f99/ptO20JnvWMWTTz3zl2KsPABuWT1//2fyPKaWd/4jYbC6FNkcIiRPgniyfd47w64TzdkDZbD1G43KEhnYAeDwey+f/BDjC0HuE/W1LqT0wToB7EuAI3m2mb9e2ewTsAKCZXkdo22bipm1whAY7KN1oANyQlSM8yk/1ns+W/uobWBii51gZ6/ksjgDw2DsCANwZHAEAEjgCACRwBABI4AgAkMARACBxI0fgESNAlVdzhOqbSAfHMxUj3h+5KC+WTiA3cgTAEd55sXQCyb+z+Ci/niiWMvvuo/F+Yba/rVNt34yVjdylH5Wvtw5G/+dLXEGWRIx27xBK/Fl9+9gYQhG3dSBzj1Aqk3dZHH+8/2spqmb9tnw3pau2izrPZ3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AdJJ3BHErGru39Alttr2qU40EAELIOELsz/aeY288ANDJ1hFCtl/bzhcFm6MCgCqZ/zEl08m58cIdITA2ADAYeI/wjN0uCnZGBQBVuj5HKIqG3iNgBwCH0fWsoSga5wjYAcCRdL2PUBQNcgTsAOBgeGcRABI4AgAkcAQASOAIAJD4HxJvKW81Pn91AAAAAElFTkSuQmCC" alt="" />

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

上一篇:index页面数据展示为设定的命名


下一篇:vue-cli打包到部署到nginx服务器