2017-02-25 | Paul Boddie | file changeset files shortlog | Avoided using temporary accessor variables when names are used as accessors. Added a means of communicating the context of an access to the translator so that names can be used as contexts in certain cases instead of using temporary variables. |
paul@220 | 1 | b = buffer() |
paul@220 | 2 | b.append("Hello") |
paul@220 | 3 | b.append(" ") |
paul@220 | 4 | b.append("world") |
paul@220 | 5 | b.append("!") |
paul@259 | 6 | print b # Hello world! |
paul@220 | 7 | |
paul@220 | 8 | b = buffer(["Hello "]) |
paul@259 | 9 | print repr(b) # buffer(["Hello "]) |
paul@259 | 10 | |
paul@220 | 11 | b2 = buffer(["world!"]) |
paul@220 | 12 | b.append(b2) |
paul@259 | 13 | print b # Hello world! |