Hacker News new | ask | show | jobs
by lucio 2833 days ago
That syntax was irregular but very useful. It was not surprising or confusing.

A$ = "ABCD"

MID(A$,2,2)="12"

PRINT $A

>A123

2 comments

Assuming a typo here, but I would be surprised if the output contained "3"
This 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.)