New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any type #1

Merged
merged 7 commits into from Aug 5, 2016

Conversation

Projects
None yet
2 participants
@nadako
Member

nadako commented Jul 21, 2016

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

This comment has been minimized.

Member

ncannasse commented Jul 22, 2016

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

@nadako

This comment has been minimized.

Member

nadako commented Jul 22, 2016

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

This comment has been minimized.

Member

nadako commented Aug 1, 2016

Ping!

@skial skial referenced this pull request Aug 1, 2016

Closed

Haxe Roundup 367 #321

@nadako

This comment has been minimized.

Member

nadako commented Aug 5, 2016

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

  • in general: the proposal is good
  • about unresolved question of autocasting: it should autocast
  • about standard library usage: add Any usage to unserializers and reflection, but hide it behind a define, so by default it uses Dynamic like before, but can be easily switched to Any, so people can test their codebases
  • about when to add this: should be safe for 3.3 release (both Any and #if's)

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

@nadako nadako merged commit 7b5eda9 into master Aug 5, 2016

@nadako nadako deleted the any branch Aug 5, 2016

@ncannasse

This comment has been minimized.

Member

ncannasse commented Aug 8, 2016

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

This comment has been minimized.

Member

nadako commented Aug 8, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment