Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'syntax': 0.04; 'subject:Python': 0.06; 'lookup': 0.09; 'pointers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:language': 0.09; 'sure,': 0.09; 'marker': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'structs': 0.16; 'subject: \n ': 0.16; 'subject:programming': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'wed,': 0.18; 'saying': 0.22; 'header:User-Agent:1': 0.23; 'pointer': 0.24; 'subject:/': 0.26; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'dec': 0.30; 'division': 0.31; 'struct': 0.31; 'allows': 0.31; 'figure': 0.32; "we're": 0.32; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'useful': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'so,': 0.37; 'two': 0.37; 'being': 0.38; 'auto': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'days': 0.60; 'dave': 0.60; 'middle': 0.60; "you're": 0.61; 'information': 0.63; 'valuable': 0.63; 'different': 0.65; 'funny': 0.74; 'potentially': 0.81; 'adorn': 0.84; 'local,': 0.84; 'angel': 0.91; 'thing,': 0.91; 'choice.': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Neil Cerutti Subject: Re: Experiences/guidance on teaching Python as a first programming language Date: Wed, 18 Dec 2013 15:17:34 +0000 (UTC) Organization: Norwich University References: <20131212213602.806ef8fd2626ca6f34bc83d6@gmx.net> <20131216213225.2006b30246e3a08ee241a191@gmx.net> <20131217165144.39bf9ba1cd4e4f27a96893ca@gmx.net> <52b0fb4f$0$29973$c3e8da3$5496439d@news.astraweb.com> <52b15b62$0$29973$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: jackman.norwich.edu User-Agent: slrn/0.9.9p1/mm/ao (Win32) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387379884 news.xs4all.nl 2916 [2001:888:2000:d::a6]:59644 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62309 On 2013-12-18, Chris Angelico wrote: > On Wed, Dec 18, 2013 at 11:53 PM, Dave Angel 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