3 ms·
Some of them allowed to use MID$ for the left-hand side of an assignment to replace a substring, which is also unexpected.
by rzzzt 8y ago
Some of them allowed to use MID$ for the left-hand side of an assignment to replace a substring, which is also unexpected.
- pvg 8y agoMID$ still took a string as an argument, though, right?
- rzzzt 8y agoYup, see https://news.ycombinator.com/item?id=17998173 https://news.ycombinator.com/item?id=17998173 for an example.
- lucio 8y agoThat syntax was irregular but very useful. It was not surprising or confusing. A$ = "ABCD" MID(A$,2,2)="12" PRINT $A >A123
- bbernoulli 8y agoAssuming a typo here, but I would be surprised if the output contained "3"
- quietbritishjim 8y agoThis is still going strong today in list slice notation in Python (and other languages, no doubt): x = [1,2,5,6] x[2:2] = [3,4] print(x) (Slice notation can be used on any collection, not just lists, but you can't use it in assignment like that for strings because they're immutable, so you'd have to convert to a list of characters and back.)