I thought I remembered reading that if there are two different string literals in an I6 program, they would both reference the same value, which is an address where the Z-encoded string is held in ROM. Is that the case? I’m asking because in this code it looks like maybe that’s not the case:
Global abc_str = "abc"; [ Main x ; print "abc_str = ", abc_str, " / (string) abc_str = ", (string) abc_str, "^"; x = abc_str; print "x = ", x, " / (string) x = ", (string) x, "^"; print "abc literal = ", (string) "abc", "^"; x = "abc"; print "new x = ", x, " / (string) new x = ", (string) x, "^"; ];
This produces (with comments added after the fact):
abc_str = 769 / (string) abc_str = abc ! 769 is memory address for Z-encoded "abc" x = 769 / (string) x = abc ! x holds same address abc literal = abc new x = 771 / (string) new x = abc ! 771 is memory address for second and separate Z-encoded "abc"? [Hit any key to exit.]
Am I misinterpreting what the output means? If so, why is new x different than x in the output?