Re: [RFC] [DISCUSSION] Scalar Pseudo-type
| From: | Fleshgrinder | Date: | Fri, 29 Dec 2017 12:56:01 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Scalar Pseudo-type | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101435@lists.php.net to get a copy of this message | ||
On 12/29/2017 1:26 PM, Rowan Collins wrote:
> On 29 December 2017 12:08:16 GMT+00:00, Fleshgrinder
> <php@fleshgrinder.com> wrote:
>> What is the use case for
int|float? I mean, if f is able to
>> process a float than f is able to process an
>> int and since
>> int is already automatically changed to a µáõf
c8�›
>> ÈV3|float, well, you're
>> done.
>
> I think it is somewhat tedious if we discuss every possible pair of
> types, just as it would be somewhat messy if we added a new keyword
> for every combination we found a use case for. The beauty of a
> general-purpose syntax is precisely that a user can use whatever
> combination they need, and not use combinations they don't need. I'm
> sure there are plenty of nonsensical or redundant checks that can be
> expressed in other parts of the language, but that doesn't mean those
> language constructs are useless or damaging.
>
> Regards,
>
I agree and I do not intend to do so, I actually am not even questioning
the usefulness of union and intersection types. I am more curious in
regards to providing a number type. Seems useless to me.
--
Richard "Fleshgrinder" Fussenegger