Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86394 invoked from network); 4 Jun 2016 17:13:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2016 17:13:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.84 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.84 mx103.easyname.com Received: from [77.244.243.84] ([77.244.243.84:36622] helo=mx202.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/18-25194-C2C03575 for ; Sat, 04 Jun 2016 13:13:17 -0400 Received: from cable-81-173-133-15.netcologne.de ([81.173.133.15] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b9F8K-0004Rt-8h; Sat, 04 Jun 2016 17:13:12 +0000 Reply-To: internals@lists.php.net References: To: Rasmus Schultz , PHP internals Message-ID: <9e90ada7-b2a9-2029-6e7f-4f4995f4507b@fleshgrinder.com> Date: Sat, 4 Jun 2016 19:12:46 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Oar3CFvobpivwJHtpu7FhQjVt3bBJReTj" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof From: php@fleshgrinder.com (Fleshgrinder) --Oar3CFvobpivwJHtpu7FhQjVt3bBJReTj Content-Type: multipart/mixed; boundary="oHgC7nBstaKwuj6dDKe6434362vmPpJF2" From: Fleshgrinder Reply-To: internals@lists.php.net To: Rasmus Schultz , PHP internals Message-ID: <9e90ada7-b2a9-2029-6e7f-4f4995f4507b@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof References: In-Reply-To: --oHgC7nBstaKwuj6dDKe6434362vmPpJF2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/4/2016 7:09 PM, Rasmus Schultz wrote: > Hi Richard, >=20 > I can't review the implementation, but the RFC looks good - great > initiative! >=20 > The only thing I would comment on, is the idea of packing essentially t= wo > different functions into one - by default, the return value is a > machine-friendly type-name, but the $extended argument turns it into a > different function altogether, producing a human-readable type-descript= ion. >=20 > It seems like you have two functions in one, and I personally would pre= fer > having two functions. >=20 > Other than that, this looks like a nice replacement for e.g. this lengt= hy > switch-statement: >=20 > https://github.com/mindplay-dk/readable/blob/master/src/readable.php#L3= 0 >=20 > Incidentally, this library creates "more readable" representations of e= =2Eg. > closures, displaying filename and line number, which would be another > nice-to-have, and another good reason to separate the human-readable > function from the machine-friendly function. (I wrote this library most= ly > to create readable representations of e.g. invalid arguments so I can t= hrow > exceptions with more helpful messages - it would be great if that was n= o > longer necessary.) >=20 Hi Rasmus, thanks for the very positive feedback and this is exactly the target I am aiming for with the proposal. I am more than open to the idea of splitting the functionality because after all I am a big friend of the Unix philosophy. The hard question to answer is, how to call that function? typeof_extended() is kind of weird ... I will definitely investigate. :) --=20 Richard "Fleshgrinder" Fussenegger --oHgC7nBstaKwuj6dDKe6434362vmPpJF2-- --Oar3CFvobpivwJHtpu7FhQjVt3bBJReTj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXUwwXAAoJEOKkKcqFPVVr09YP/Ah5uXK14ToLqfe8Fa4UmJQg NATel0XXLU4KgKMn20OmwjwATAjXGBjXbA7v24OlOpmYGHmGGoiI30W9JMFpcT2t igdrKfec4YvkBt7qrNr9RMbOdov9ixMC2tR80ZDrcM2JW/2SJiuPKebZC/FVt1Tn P1lJ0O0RsqPrVY02RAwHfARZbgzx44vDb/omfC5GyKdVYVIIWN3pQZpjcTBLEjts fs5EnIVUpfwhqjT8/W4IKDrjAWj3Ht1Tk6yLi5U2cFtzhb8VXVzGR2UDHUrCTilp J5qIKcWVLYqhGCF/DLMn2GGgFuZKn1CeXSqmevxsXAp0BGB4ubHYQeNyxs4WK6UE G5+MINN/jjBMqrecKuByAhZgLI68wxMgopOs4f42RRWO67kYOMR7Dji+MRJjfVjv yAV4mfNtOJ3WfsccpUlfznieHHi+sVW07W8T6hFEN7D0BIMW5Hd/F/HfoieKFfY5 X69szKJ7Wwiq+kB61zccFqxGeIcpsqbKS8DTvuI3Q8ax+Felo4ClD1ViyjHW507Q HVeHteKPP/QkmarNYjL1PMf4dwnuXCHbsxK7dwQzB/zVWFY/OJ992U6bJL2V/aQ+ CwpNvFpO3djb0riaQ4xf+tsDda8M3Vhc20cApcSZzwJF/ZHb86+Lgs+jsfekEQkt Np6g/XZ2m8iSwdzzyf2s =xFpE -----END PGP SIGNATURE----- --Oar3CFvobpivwJHtpu7FhQjVt3bBJReTj--