Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!81.171.88.16.MISMATCH!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4a.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; 'true,': 0.05; 'subject:Python': 0.06; 'assignment': 0.07; 'compiler': 0.07; 'odd': 0.07; 'cc:addr:python-list': 0.11; '"alternate': 0.16; '"def"': 0.16; 'def.': 0.16; 'detects': 0.16; 'does,': 0.16; 'expression,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'lambda': 0.16; 'magic': 0.16; 'syntax,': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'looks': 0.24; 'cc:2**0': 0.24; 'least': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'limitations': 0.36; 'easily': 0.37; 'being': 0.38; 'pm,': 0.38; 'expression': 0.60; 'name': 0.63; 'subject:! ': 0.74; 'square': 0.74; '2015': 0.84; 'magical': 0.91; 'to:none': 0.92 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:cc :content-type; bh=2yIzc25MwBcocGIM4ALW7SKetyC4F6rx9w+7xWrPpI8=; b=gJGMm4tcFn1ETNFxDq4uIOrVuKYBfzAEgBji8q1WKUaQH1R4fmbKqJwt2dfouMsO07 2iAatXXgew7yKAJybmUBs/FllWXydwj1SkFjaYK9yM6Pl7gLg6nRmHSzQo7M+IfnQ+PH 4OPr0Az6eX27icB4oFcPaU2a4p2ecg4/lISd5hFQvJzIDX7B1X3FyKZQyPgLhlWbqopK zUc8cUDfeoucnaR6+zhFJKCTkn7/fM9VOXQbqI2RWpGE84+lWjOxJ5/cQTEHFRF67OHU Wp2AsengtmXhldQjIGzmkn9o9KMrEGOUPqLfcU7eYcCD2+3vqA8hvdtTryDOQuDIb0XM 2FbA== MIME-Version: 1.0 X-Received: by 10.50.61.238 with SMTP id t14mr10929952igr.34.1423383667381; Sun, 08 Feb 2015 00:21:07 -0800 (PST) In-Reply-To: <54d71681$0$13000$c3e8da3$5496439d@news.astraweb.com> References: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> <54d6b1a0$0$6917$e4fe514c@dreader36.news.xs4all.nl> <54d71681$0$13000$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 8 Feb 2015 19:21:07 +1100 Subject: Re: Python is DOOMED! Again! From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423383675 news.xs4all.nl 2909 [2001:888:2000:d::a6]:34308 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 3789831190 X-Received-Bytes: 4399 Xref: csiph.com comp.lang.python:85352 On Sun, Feb 8, 2015 at 6:55 PM, Steven D'Aprano wrote: > If this were syntax, then the compiler could just as easily set the function > name from -> as from def. Lambda has the limitations that it has because it > is an expression, not because of magical "def" properties. True, it could, but it would be odd that what looks like assignment and an expression is actually magical syntax. But it might be nice to have something that functions as lambda currently does, unless it detects that it's being assigned directly to a name, in which case the magic kicks in and it gets a name. square = x->x**2 # Name is "square" operator["square"] = x->x**2 # Maybe? create_operator("square", x->x**2) # Name is "" But I suspect that this would create some hairy grammatical quirks. Still, as an "alternate syntax for creating a lambda function", it seems at least plausible. ChrisA