-2

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.

1 Answers1

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