Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114502 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2729 invoked from network); 17 May 2021 15:24:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 May 2021 15:24:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A1B36180532 for ; Mon, 17 May 2021 08:33:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 17 May 2021 08:33:43 -0700 (PDT) Received: by mail-ej1-f46.google.com with SMTP id p24so8603534ejb.1 for ; Mon, 17 May 2021 08:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ygdJyCMmbMjOdtCzew8zSqK0BnWVVqxnu0lo0t7J8b4=; b=r4tr+yKNlb+TaXes90iC6TUuj6cB51gfDUq+JrfNkQLreImyIRmkMpPm+56r2nCNY1 URuIdNblnTGJ4t5nXeOs8Kkrjrg626R9LcmnwpYV3sj3oMD9rQcvIPNd2j3HcWjD6YHW qX51iehDlYZeZZK8USAtTn2pFQT8BXTcRcBW7BBIY4RwQs4xrDpOfyxgPC7qXWhtl3BC xZ1m8+3TFGNef9Ifdvwr5/CihGmRfcWeJk5SSioIFfOLPoTSoOuoqI2zyEOd3xEzlqim kkdzgh3ssaJzelWeV7Y7FPr71FmZVBtn09btL3oqrYG3mJi9la7PJ+4vvLJVsSfAD2bk BiAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ygdJyCMmbMjOdtCzew8zSqK0BnWVVqxnu0lo0t7J8b4=; b=sP8RiOA2pj2Hy5GveC7dX/fm2/pX3BiloSaCvOL4fd2LWxZF3R2tNWbgAmBSbCbgQB XfT9za9J/mERx7gH8Q8gthkUiqQymE6NJeQgxZ8X9eOpxouInQi4hdtEztOj5Wjrh04I 9s27JvOcCT+ZfXbkQX2lIKw0uD6srLsXdBgGb6cB64w5RuU7DNdKXbqMlzFDkjjzjI8J 2VQPg238ds9mlCi38+u2QPQ1+OmRC7yG4cd55mLrcvRupzLztgqc8plAsZ3R2K/q6MQo IL5AYD3xWNs8VinWnsS+AdGrk7Z5ibs5hvPSOR7Thmng+LfH2Vd1a4RMqQOGXle4dAmU wiWA== X-Gm-Message-State: AOAM532dikTtXgXRdHv6rroHrOdxOHl43/GSvG/PqT0pm5t4ouQK2iz8 gtRHPVDokFt/0zADmX/ghgxfOjlKQqOUJZej/zS3rm8cEhs6Y1Pu X-Google-Smtp-Source: ABdhPJwOoWtMTxz7/F48N/pB/cn1Aw7EuxCKPxENm6dV9hnC+KeUgIz+OlzfzCyXRN84L8yXDfFKnmVa9GpNyUuklxg= X-Received: by 2002:a17:906:3883:: with SMTP id q3mr520822ejd.4.1621265619571; Mon, 17 May 2021 08:33:39 -0700 (PDT) MIME-Version: 1.0 References: <1565EB81-57B7-49B0-A47C-342E0088A432@trowski.com> <09B663C3-E21D-432B-BB7F-78312F827C30@newclarity.net> <5B96C4C4-A324-4EF8-8196-83480E897884@newclarity.net> In-Reply-To: <5B96C4C4-A324-4EF8-8196-83480E897884@newclarity.net> Date: Mon, 17 May 2021 18:33:22 +0300 Message-ID: To: Mike Schinkel Cc: Guilliam Xavier , php internals Content-Type: multipart/alternative; boundary="000000000000575a5505c2885100" Subject: Re: [PHP-DEV] [RFC] Partial function application From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --000000000000575a5505c2885100 Content-Type: text/plain; charset="UTF-8" On Mon, May 17, 2021 at 6:16 PM Mike Schinkel wrote: > > > > On May 17, 2021, at 10:50 AM, Guilliam Xavier > wrote: > > > > > > > > On Mon, May 17, 2021 at 6:58 AM Mike Schinkel > wrote: > > > > Casting is another interesting approach that does feel more consistent > with the existing language. > > > > Since it *is* creating a closure, wouldn't this make the most sense? > > > > $partial = (closure) abc(); > > > > Ouch! definitely NOT! > > > > $partial = (closure) xyz(?,24); > > > Mind if I ask for you to elaborate on your aversion? > > Asking for general understanding, not to debate the point. > > -Mike Hey Mike, Let me share something that's possible now and it would be pretty weird with the casting syntax: *(function (...$params) { var_dump($params);})(?, 2)(1, ?)(?, 4)(?, ?, 6)(?, 5)(3, ?)(7);* Will pass the parameter 1, 2, 3, 4, 5, 6, 7 in order to the closure that was initially defined. I think casting requires extra grouping. --000000000000575a5505c2885100--