What’s Wrong with OOP and FP

logicchains jonathan.t.barnard at gmail.com
Wed Nov 13 18:37:51 PST 2013


On Wednesday, 13 November 2013 at 16:12:01 UTC, Andrei 
Alexandrescu wrote:
>
> If the purpose was to make it clear dereference is happening 
> (presumably to have people understand the efficiency issues 
> associated), I wonder why they didn't make memory allocation or 
> indirect calls (both of which abound in Go) more visible. Was 
> there some other intent behind (*pt).X?
>
> Andrei

Looking through the Go spec, it seems I was confused. A pointer 
to a struct can be used with just pt.X, and a pointer to an array 
*arrp can be used with just arrp[0], but a pointer to a _slice_ 
*slcp can only be used with (*slcp)[0], not slcp[0]. I have no 
idea why this is.


More information about the Digitalmars-d mailing list