Skip to content
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

[std] use map literal syntax in Map's toString() #8030

Open
Gama11 opened this issue Mar 21, 2019 · 3 comments

Comments

@Gama11
Copy link
Member

commented Mar 21, 2019

In the context of modern Haxe with its map literal syntax, Map's string representation feels a bit unnatural, as it uses {} instead of []:

class Main {
	static function main() {
		trace([1 => "one"]); // {1 => one}
	}
}

I'm assuming that this is from a time before Haxe had map literals?

Changing it might be considered a minor breaking change.

@Gama11 Gama11 added the enhancement label Mar 21, 2019

@Simn Simn added this to the Design milestone May 22, 2019

@uvtc

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

Seeing this inconsistency surprised me. I think it gives prospective new users the impression, "if low-hanging fruit like this hasn't been fixed yet, what bigger bugs will I stumble over down the road?".

@Simn

This comment has been minimized.

Copy link
Member

commented Aug 3, 2019

I agree that this should be fixed, but invoking the confused new users trope just makes me less likely to look into something.

@uvtc

This comment has been minimized.

Copy link
Contributor

commented Aug 3, 2019

Cool. Though, I didn't say that it confused new users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.