Why is D unpopular?
Walter Bright
newshound2 at digitalmars.com
Mon May 2 21:31:28 UTC 2022
On 5/2/2022 12:04 AM, Patrick Schluter wrote:
> From wikipedia
> ````
> Unlike the LEFT$(), MID$() and RIGHT$() functions used in the ubiquitous
> Microsoft BASIC dialects for home computers, parts of strings in Sinclair BASIC
> are accessed by numeric range. For example, a$(5 TO 10) gives a substring
> starting with the 5th and ending with the 10th character of the variable a$.
> Thus, it is possible to replace the LEFT$() and RIGHT$() commands by simply
> omitting the left or right array position respectively; for example a$( TO 5) is
> equivalent to LEFT$(a$,5). Further, a$(5) alone is enough to replace MID$(a$,5,1).
> ````
> and what's not mentioned in the wikipedia is that the slicing also worked as
> lvalue. ´a$(5 TO 7)="12"´ was possible.
>
Nice. Slices are a huge deal.
More information about the Digitalmars-d
mailing list