On 2013-12-18, Chris Angelico <ros...@gmail.com> wrote: > On Wed, Dec 18, 2013 at 11:53 PM, Dave Angel <da...@davea.name> wrote: >> Funny you should say that in the middle of a discussion about >> lifetime. In C, when you do the -> thing, you're now in a >> different struct with a potentially different lifetime. If p >> is a local, with auto lifetime, then so is p.x >> >> So, although the two are mutually exclusive, there's valuable >> information hidden in the required choice. > > Sure, but you can figure out whether p is a local struct or a > local pointer to some other struct by looking at its > declaration. Do you also need to look at every usage of it? We > don't adorn every / with a marker saying whether we're dividing > ints or floats, and that's something that could be potentially > useful (float division of two ints being what Py3 does). Why > adorn pointer usage?
Indeed. Golang allows . to do member lookup for both structs and pointers to structs. The -> syntax perhaps was needful in the days before function prototypes. -- Neil Cerutti -- https://mail.python.org/mailman/listinfo/python-list