Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Inside index and slice expressions for built-in arrays, D allows the symbol $ to stand in for the length of the array. For example, a[0 .. $ - 1] selects all but the last element of built-in array a.
Although it seems like quite a minor feature, $ has consistently been an important contributor to people’s enjoyment of using D arrays. Conversely, the fact that $ was “magic” and couldn’t be overloaded has been a perennial source of irritation—evidence supporting the view that built-in types should seldom have powers inaccessible to user-defined ones.