What’s Wrong with OOP and FP
deadalnix
deadalnix at gmail.com
Wed Nov 13 10:25:17 PST 2013
On Wednesday, 13 November 2013 at 12:05:51 UTC, logicchains wrote:
> On Wednesday, 13 November 2013 at 11:30:14 UTC, eles wrote:
>> On Wednesday, 13 November 2013 at 10:19:34 UTC, logicchains
>> wrote:
>>> On Wednesday, 13 November 2013 at 09:12:40 UTC, Jonathan M
>>> Davis wrote:
>>
>>> struct, then I have to write (*pt).X to access field X of that
>>
>> It is in our guidelines too. I almost never write "->".
>
> Ah, right. I just tested, and turns out Go does actually
> automatically dereference pointers to structs, but not to
> arrays. So if arrp is a pointer to an array, writing arrp[0] is
> a syntax error in Go, and it must be written as (*arrp)[0]. D
> on the other hand, as far as I'm aware (correct me if I'm
> wrong), would automatically dereference the pointer.
I don't think so. D would index the pointer (as if it pointer to
an array of slices).
More information about the Digitalmars-d
mailing list