HaxeFoundation / haxe-evolution

Repository for maintaining proposal for changes to the Haxe programming language
111 stars 59 forks source link

Any type #1

Closed nadako closed 8 years ago

nadako commented 8 years ago

This proposes introduction of the new Any type as a safer alternative to Dynamic when it comes to simply holding "any value".

Rendered version here

ncannasse commented 8 years ago

Is there any change in standard library where it would make sense to use Any instead of Dynamic?

nadako commented 8 years ago

As mentioned in the proposal, haxe.Unserializer.run and haxe.Json.parse are good candidates for this.

I would also use Any instead of Dynamic for method signatures of Reflect, since IMO reflection is a higher level concept than dynamic, and staying type-safe there would be a good thing.

But changing any of this would be a breaking change, so I'm not proposing to do it for now. Maybe we can revise that for Haxe 4.

nadako commented 8 years ago

Ping!

nadako commented 8 years ago

Unfortunately, the discussion took place in the internal Slack chat instead of this PR, but here's the summary:

I'll now adjust the proposal text and merge it. After that I'm gonna adjust and merge the implementation PR to Haxe repository.

ncannasse commented 8 years ago

Please note that we didn't correctly respected the protocol here : have a consensus between me and Dan does not mean we have a majority to accept the HXP.

nadako commented 8 years ago

You're right... That was unfortunate. I was too excited to get it merged... We need to get everyone to vote somehow...