Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105263 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58387 invoked from network); 12 Apr 2019 18:29:08 -0000 Received: from unknown (HELO mail-wr1-f43.google.com) (209.85.221.43) by pb1.pair.com with SMTP; 12 Apr 2019 18:29:08 -0000 Received: by mail-wr1-f43.google.com with SMTP id s15so12447740wra.12 for ; Fri, 12 Apr 2019 08:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XCOVX5OVAIGn7mRI7ETrkbgDh9zhXpsotPo6t1di7TY=; b=ZGmHaGZshJO9w4Wo0hx/DpwDnkOQY/Z8//VJta6H7mMUD2VLAcexSBuHvqoEHQcKSW WNjT+ZdrXIvcPaDHSX6cLFVt/La1m5hWDLSgWkBbKdvlj7QNTclNXph4aam5rmnec3ap RvOvFBUKb+DpCnV9vwDDli2vWDtSTjvZHgqgqw0b1+wFQ4TBKdAMtE+3UvHY6HWxA9gA 8sbTn0WnLZ//SxhdG7Ztm+eYk0Qt2qapOaCJp2xbxkToctgdWGk13lK0/Rop42LIbnim fc/clX/2jOLdgH8WPisKNT0RsF1hWZLvb/bvspTAUfnSHkMjTpDKUTnoWHvURRAoWRSR Xx7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XCOVX5OVAIGn7mRI7ETrkbgDh9zhXpsotPo6t1di7TY=; b=icLYxy3Cz/z8wPwBPsBNv9Yo9qa7yFmtswpYZzcMwgm/QorvVhJ4y9QvcUFTKcIx6D gWTF4Wd5isM6jYjj2EUg3GxaaViFctCvn9y1YIRbIfgWbZXz9gq0q4TwV0BkrQL78rJ1 B1ZkJNYF/bgVBlHOoLVR8hPINSI65Pd+i1ReWjOiVQE8anTy0Paqx3oRfswLQfpYy9ri yMIuUtYvspIDmg/lfAh4RTnKyTnItvz2q67QWTDLzFt9CiOTA+Dw+BOX1VTXCFcKx9+S AAKRJUwp5YSv/YAe3MxQuF6myVn7wFpzzdm0uiOwReascThOoj5d3bTl5GsJzCikWPZX bUsg== X-Gm-Message-State: APjAAAXF0Rm0Mhi+0R5UlT9VeXZzGQPRzeSNnh0rgbif3XOofhp+a5uD xkibVbTs8d+WZ2BLlK9VCVE= X-Google-Smtp-Source: APXvYqw1pZALbzZz1jAJqJiGKHdevNMSZDqMP+Po1z+GTeS13o6zloa/o24E5/ZPOZKQbkmw0i109w== X-Received: by 2002:adf:fc47:: with SMTP id e7mr31883848wrs.100.1555082807805; Fri, 12 Apr 2019 08:26:47 -0700 (PDT) Received: from [10.8.0.205] (221.ip-51-38-36.eu. [51.38.36.221]) by smtp.gmail.com with ESMTPSA id c10sm49063331wrt.65.2019.04.12.08.26.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 08:26:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) In-Reply-To: Date: Fri, 12 Apr 2019 17:26:45 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <582b57dc-42a0-582b-9471-2ede97ba584a@telia.com> <9C232925-ECA1-4DB3-91A5-FE76C3BA1F4A@koalephant.com> <6A90A882-6DD3-48CB-94CA-82059F6949B8@gmail.com> To: Theodore Brown X-Mailer: Apple Mail (2.3445.102.3) Subject: Re: [PHP-DEV] Re: [RFC] Arrow functions / short closures From: fabacrans@gmail.com (Fabien S) > On 12 Apr 2019, at 16:46, Theodore Brown = wrote: >=20 > On Thursday, April 11, 2019 at 10:22 AM Fabien S = wrote: >=20 >> I really like the Haskell `\($x)` syntax, could someone confirm if >> it would possible to drop the parenthesis (like `\$x`) if we have >> one argument ? >=20 > The RFC says this syntax is ambiguous without the parentheses, since > the `\` may also be part of a fully qualified type name. [1] >=20 > I'm not sure whether it would work if the single parameter isn't = typed. >=20 > I like the Haskell syntax as well, but I'd also be okay with the `fn` > keyword if that's what others prefer. >=20 > [1]: https://wiki.php.net/rfc/arrow_functions_v2#miscellaneous Thanks for the clarification, I should have been more specific but I saw = you used `\$x` in your previous message and I was wondering if this = syntax is unambiguous. Basically: ```php \$x =3D> $x + 1; // One (not typed) argument, no parenthesis needed \(int $x) =3D> $x + 1; // Typed, parenthesis needed \($x, $y) =3D> $x + $y; // Multiple arguments, parenthesis needed ``` I don't think it's really important but it would be pretty handy syntax = in my humble opinion.=