Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'pop': 0.05; '21,': 0.07; '"("': 0.09; 'counting': 0.09; 'cc:addr:python- list': 0.11; '":"': 0.16; 'cc:name:python list': 0.16; 'indent': 0.16; 'pythonic': 0.16; 'subject:?)': 0.16; 'top:': 0.16; 'language': 0.16; 'wrote:': 0.18; 'stack': 0.19; 'thu,': 0.19; '(in': 0.22; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'skip:" 20': 0.27; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'maybe': 0.34; 'could': 0.34; 'subject: (': 0.35; 'received:google.com': 0.35; 'next': 0.36; 'hi,': 0.36; 'truly': 0.60; 'to:addr:gmail.com': 0.65; 'yours': 0.88; 'wanting': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=dPipyDv91uLbG0itWDZ/s7P4fv7l9/mGRt2X1vTqFeY=; b=MBr1L6DrjU83aqwYFqrcH0AFrSprWm9SidD4eBH1K7cHc80mRfLWGJr3dAHd81oP1W JD3KKW6y5BCdLtotuVcsYqPtpo5RvruEiH4boS+ViKNdIsnHGhW0QNz2TinVvkySn2xa yL/9rklnfq6km9mE3yD5IT4qL2+pE7msYsFWNhYUketta4BOHiOvNmms+RHEPhUw5Q+G i3uRRX+2FMts68aobZzJ/Gu5jnYbTzZvUE2SeC23mDEOgs4e1Zj5BBpdUxUjarTJpNH0 vqrn1TR4MoFsOW8IFcMlXY3daJUvsUPgM8iCd9A2R2Zk5ADnRglOEvpOslpS3nTbxuuu cw3A== MIME-Version: 1.0 X-Received: by 10.112.98.198 with SMTP id ek6mr7058613lbb.22.1408751321326; Fri, 22 Aug 2014 16:48:41 -0700 (PDT) In-Reply-To: <1bd05b41-ad00-4ce8-8678-de51205ebc3b@googlegroups.com> References: <1bd05b41-ad00-4ce8-8678-de51205ebc3b@googlegroups.com> Date: Fri, 22 Aug 2014 16:48:41 -0700 Subject: Re: proposed syntax for multiline anony-functions (hopefully?) From: Dan Stromberg To: icefapper@gmail.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Python List 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408751328 news.xs4all.nl 2888 [2001:888:2000:d::a6]:57062 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76833 On Thu, Aug 21, 2014 at 12:55 AM, wrote: > Hi, just wanting to do a shot in the dark,but maybe this syntax is Python= ic (in a "we-are-all-grown-ups" fashion, ahem)enough to get its way into th= e language > this is what yours truly thinks: don't we all know that ":" means the nex= t token must be an indent (mostly)? and doesn't the "(" and its alikes, [ a= nd } begin an space-insensitive lexing context? so all we need is having an= "space-sensitivity-stack" and the corresponding "(" counting stack and thi= s way we could match opening and closing "()" and pop the space-sensitivity= -stack whenever the "(" counting stack gets a 0 at the top: