I am learning ETS. I did:
Sometab = ets:new(sometable, [bag]).
ets:insert(Sometab, {109, ash, 8}).
Then I typed:
ets:match(Sometab, {109, ash, '$1'}).
However instead of getting 8 – I am getting: ["\b"] as output!
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.
You are getting the correct answer. However, the erlang shell prints
[8]as"\b"since the ascii code forbackspaceis 8.Erlang has no string type. Strings in erlang are represented simply as a list of integers and the Erlang shell prints this list as a string if the list contains integers withing the ascii range only.
This can indeed be confusing at times.