On 4/17/2016 2:19 PM, Lester Caine wrote:
> On 17/04/16 11:29, Fleshgrinder wrote:
>> Especially since its not needed at all. HHVM already solved most of
>> these issues extremely nicely:
>>
>> - https://docs.hhvm.com/hack/types/type-system
>> - https://docs.hhvm.com/hack/type-aliases/introduction
>> - https://docs.hhvm.com/hack/shapes/introduction
>>
>> We want the same but do not want to copy?!?
> 
> The simple answer NO
> 
> If that is how you think it should be done, then use it. On my platform,
> 'point' is a number of floating point numbers depending on your
> geometry. And shapes use those points. So that area of 'hack' is of
> little use to any mapping system, and trying to shoehorn existing code
> to fit is 'pointless' ...
> 
> It's the fact that many of these problems HAVE been solved without
> resorting to overloading PHP with a subset that does not provide a
> complete solution to the alleged problems that is the reall problem
> here. Having to re-write libraries because some one else thinks the
> basic rules are wrong and need fixing :(
> 

Why do you need to rewrite anything?
Why do you need to use it?

Especially, why do you thing that PHP was made solely for auto-mappers
from some SQL to PHP?

    $array_point = array('x' => 0.0, 'y' => 0.0); // valid

    type Point = shape('x' => float, 'y' => float);
    $point = shape('x' => 0.0, 'y' => 0.0); // valid

    function distance(array|Point $p1, array|Point $p2) {
        // works
    }

    function distance(Point $p1, Point $p2) {
        // works better
    }

    var_dump($point);

    // array(2) {
    //   ["x"]=>
    //   float(0.0)
    //   ["y"]=>
    //   float(0.0)
    // }

Both works and both is valid. Only the latter case ensures that it is as
defined and the former allows arbitrary changes. If you need arbitrary
changes go for it. It does not matter why you want to use the former
(anemic domain, legacy support, no time to adopt, no muse to adopt,
"everything was better in the old days", ...) as long as it solves your
use case and satisfies your users. All changes that were proposed are
*without any BC!*

If you are only afraid that usage of your libraries declines because
users demand these new features to be part of it and you do not want to
implement them. Sorry, but that would be a clear sign that the features
are good and should be used.

-- 
Richard "Fleshgrinder" Fussenegger

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to