Re: Re: Improving PHP's type system
| From: | Fleshgrinder | Date: | Wed, 13 Apr 2016 20:02:51 +0000 |
| Subject: | Re: Re: Improving PHP's type system | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92262@lists.php.net to get a copy of this message | ||
On 4/13/2016 9:57 PM, Levi Morrison wrote:
> On Wed, Apr 13, 2016 at 1:10 PM, Fleshgrinder <php@fleshgrinder.com> wrote:
>> Nothing to add other than +1, however, didn't you already write those?
>>
>> https://wiki.php.net/rfc/nullable_types
>> https://wiki.php.net/rfc/union_types
>>
>> Or is this just an announcement that these will be finalized now?
>>
>> Btw. I am in favor of having the question mark as a suffix and not as a
>> prefix because it is more readable and more natural to type.
>>
>> function fn(string? $str): bool?;
>>
>> Declare a function with the name fn that takes a string argument that is
>> nullable which will return a bool or null.
>>
>> That is exactly how I would think about the above while writing and
>> reading. :)
>>
>> --
>> Richard "Fleshgrinder" Fussenegger
>>
>
> I have written them but later they will be formally moved to Under
> Discussion and will create new threads for them here on the mailing
> list.
>
Awesome, let me know if I can be of any help, even if it is only proof
reading. This is an extremely valuable addition that I want to have.
May I suggest you the following article (more of a starting point into
Ceylon actually) regarding this topic:
http://ceylon-lang.org/documentation/tour/types/
Ceylon is very nicely designed regarding union and intersection types
and I think it can add value to learn from these people too. I am not
handing out this because I think that you don't know what you are doing.
The opposite is the case. However, Ceylon is very young and I don't
think many people know of it; while you probably already know all the
oldies who support union and intersection types. ;)
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc