What’s Wrong with OOP and FP

logicchains jonathan.t.barnard at gmail.com
Thu Nov 14 00:24:08 PST 2013


On Thursday, 14 November 2013 at 07:24:32 UTC, Paulo Pinto wrote:
>
> Because slices are always references, so you have a double 
> indirection.

Right, that makes sense. Note though that this double indirection 
is necessary if you're passing a slice into a function that will 
modify its length, such as one that will append to it. It's more 
idiomatic to just have the function return a new slice, but 
that's slightly less efficient.


More information about the Digitalmars-d mailing list