Removal of implicit variable "length"

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Jun 6 19:17:17 PDT 2006


"Bradley Smith" <digitalmars-com at baysmith.com> wrote in message 
news:e658a2$1r3s$1 at digitaldaemon.com...

> Will use of "$" be faster than using a local reference?
>
> Unless there is a reason not to create a local reference to an array, I 
> don't think either "length" or "$" are necessary. At least "$" shouldn't 
> cause programming errors, but it does make the language more complex.

As Brad said, sometimes you don't have the luxury of using temporaries, such 
as with templates.

I doubt $ is any faster, performancewise, but it's certainly faster when 
typing.  I also wouldn't say that $ makes the language more complex - it 
adds a small amount of complexity, yes, but you also have to realize that 
it's only used in slice expressions, which in themselves are something that 
add complexity to the language!  I just think of $ as a feature of slice 
expressions. 





More information about the Digitalmars-d-learn mailing list