Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'languages,': 0.03; 'operator': 0.04; 'subject:Python': 0.05; 'forcing': 0.07; '21,': 0.09; 'stack,': 0.09; 'stack.': 0.09; 'binary': 0.13; 'cousin': 0.16; 'differently,': 0.16; 'does,': 0.16; 'idioms': 0.16; 'item)': 0.16; 'stack)': 0.16; 'syntactic': 0.16; 'cc:addr:python- list': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'seems': 0.20; 'cheers,': 0.20; 'cc:no real name:2**0': 0.21; 'trying': 0.21; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; "shouldn't": 0.23; 'steve': 0.24; 'stack': 0.24; 'received:209.85.220': 0.25; 'saying': 0.26; 'cc:2**0': 0.26; '(in': 0.26; 'code': 0.26; 'sound': 0.28; "i'm": 0.28; 'message-id:@mail.gmail.com': 0.29; 'weird': 0.29; 'example': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'differently': 0.30; 'syntax,': 0.30; 'chris': 0.30; 'usually': 0.31; 'quite': 0.31; 'yet': 0.32; 'tue,': 0.32; 'sort': 0.33; 'identical': 0.34; 'latter': 0.34; 'something': 0.35; 'two': 0.36; 'push': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'skip:" 10': 0.37; 'received:209.85': 0.38; 'despite': 0.38; 'could': 0.38; 'some': 0.38; 'becomes': 0.39; 'first.': 0.39; 'that.': 0.39; 'received:209': 0.39; 'change': 0.40; 'follow': 0.61; 'more': 0.61; 'skip:\xc2 10': 0.74; 'hand,': 0.76; 'to:addr:yahoo.com': 0.83; '"so': 0.84; 'howell': 0.84; 'sender:addr:chris': 0.84; 'downright': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bGj2vQAnaTeKfVIRFuyo9pbWTuoja80sHh8wt7k8StQ=; b=MPb6AHp0Pn7UhkyZ0Ou3nAoFlhn1GN1iBlybyciqGnN6o0Z+S3B0CteD0j0UdfnFDN Pq+U900MiEF4vx6XHRPDBVD2vRfEDgikG892JDTXWNmIPlrzkcc94I6CKTPW4umbeUg6 nKGup71YC5qOhHxoLH4FpvNi/La3iITtQwUXY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=bGj2vQAnaTeKfVIRFuyo9pbWTuoja80sHh8wt7k8StQ=; b=QHr2RTwePwESnFt/Od1PdWnEOxLGjtvH0/yL83m2/nWimr6TAEqm5x7BgsvQWUojlE wbC9/2y9gm4OeCSgfVC1135YScO/L2CC/99pgSUfXPNZ3WvTd+GhofFI4kB+y+MHb0vc OniK7AQYSXvEUK3jUVBxqt/PrHn/Hd3X9hNGaegH7LEZtLgLqw4gCU6p7FOB8TDH9iMA IGrzx+uup2HAyHyP836wpsbsB7MX57mIpkRrJ01dyU5B6SABbh0QWo+LSgmsKpFrahVA knFIjDwzuvqtsWduEIZs8fLF6TSPQjW79egY227+DxKJmMjHBKME58jnxZEuK70pYNnJ qnuw== MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <6af70db0-dc4a-48ee-9ee2-1a934846d5f2@r2g2000pbs.googlegroups.com> References: <4f612b19$0$1379$4fafbaef@reader2.news.tin.it> <50e9ceec-40f1-4ead-b2b6-87328b30d084@ow8g2000pbc.googlegroups.com> <4f691f3d$0$29981$c3e8da3$5496439d@news.astraweb.com> <87d386lmai.fsf@benfinney.id.au> <8a77bf8d-b12f-442b-a1a3-479b5d66d366@tx8g2000pbc.googlegroups.com> <6af70db0-dc4a-48ee-9ee2-1a934846d5f2@r2g2000pbs.googlegroups.com> Date: Wed, 21 Mar 2012 00:16:49 -0700 X-Google-Sender-Auth: 8cAWIVd_sUxuorslok39RPrIGH8 Subject: Re: Python is readable From: Chris Rebert To: Steve Howell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmbzjmbiLsSGrfDlCg+31HcwXofDO/6TWaCAIWpvtwXzsJesUygx6dXDP4CSX/tHOJH0S47 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332314212 news.xs4all.nl 6985 [2001:888:2000:d::a6]:33867 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21975 On Tue, Mar 20, 2012 at 11:52 PM, Steve Howell wrote: > On Mar 20, 10:40=C2=A0pm, Chris Angelico wrote: >> On Wed, Mar 21, 2012 at 3:58 PM, Steve Howell wrot= e: >> > So saying "push(stack, item)" or "push(item, stack)" seems very >> > unsophisticated, almost assembly-like in syntax, albeit at a higher >> > level conceptually than assembly. >> >> Perhaps it does, but "push(stack, item)" and "stack.push(item)" are so >> close to identical as makes no odds (in a number of languages, the >> latter is just syntactic sugar for something like the former) - yet >> they "read" quite differently, one with verb first, one with noun >> first. > > On the one hand, you say that "push(stack, item)" reads quite > differently from "stack.push(item)". > > On the other hand, you say they are "so close to identical as makes no > odds." > > I'm trying to make sense of that. =C2=A0Are you saying that the way the t= wo > idioms read makes no odds, despite reading quite differently? > >> Code doesn't follow the same grammar as English prose, and forcing it >> to usually makes it sound odd. Reader.can_comprehend(code) is True. > > Code shouldn't necessarily follow the example of English prose, but it > seems that English has had some influence: > > =C2=A01 =C2=A0push(stack, item) # Push on the stack the item > =C2=A02 =C2=A0push(item, stack) # Push the item on the stack > 3 stack.push(item) # On the stack, push the item > =C2=A06 =C2=A0item push stack =C2=A0 # Take the item; push it on the stac= k. > #4 and #5 are sort of Forth-like, maybe? =C2=A0#6 is just downright > strange. #6 is just an infix binary operator (likewise with its cousin #3, just remove the punctuation). If you change the name slightly, it becomes more sensical. One could easily write in Haskell: item `pushOnto` stack which would just be syntactic sugar for #2. Not that I endorse #6, merely saying it's less weird than you think. Cheers, Chris