A = <<"hello">>.
B = <<A:80/binary, 100:8>>.
It gives me:
** exception error: bad argument
and <<"hello">>. works, but:
A = "hello".
<<A>>.
can not work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Adoesn’t have size 80 bytes which obviously doesn’t matchA:80/binaryin first case.<<"hello">>is syntactic sugar for<<$h,$e,$l,$l,$o>>. Bit syntax expression assumes8/integer,unsigned,big,unit:1type specification by default.Ais not integer so<<A>>raisesbadargexception in second case.