When i run my program,a error hanppened, and when i look into the log, appears this {k,3108,"s"},{k,3109,"}, how can a one double quote as a varible's value.
Asked
Active
Viewed 149 times
-2
-
Could you edit your post and show the entire error message? – legoscia Jan 10 '13 at 11:32
-
Give more info about your error. Maybe is it atom? `is_atom(''). return true` – 0xAX Jan 10 '13 at 12:08
-
Sorry for a vague question,now a post the screenshot.I've tested,and make sure not a atom ''. – godnockdog Jan 11 '13 at 01:52
1 Answers
2
In the text font it is a little hard to see exactly what you actually got in the log but I am guessing it is:
{k,3108,"s"},{k,3109,''}
The first true double quotes make an Erlang string (which is really a list of integers) while the second is actually a pair of '
which is the quote character for atoms. In this case it is the atom with the empty name which is allowed. This is what @shk indicated.
But without more information from you it is really hard to give a proper answer.

rvirding
- 20,848
- 2
- 37
- 56
-
Actully, I am sure is a " rather than ''.Now i mentioned that is double quote's ascii code 34,for it print some special character like #, ☉ .but i can't actully print a " when use a erl emulater. – godnockdog Jan 16 '13 at 11:40
-
If the second `"` really is a `"` instead of `''` then there needs to be a matching `"`. No, erlang will not print a `"`, it would instead print 34 as there is no char type. – rvirding Jan 16 '13 at 15:57