开发者

Actionscript equivalent of Python's class "set"

开发者 https://www.devze.com 2023-01-21 02:10 出处:网络
In Python, there is a class called \"set\". I realize that sim开发者_StackOverflow中文版ilar functionality could be implemented in AS by a Dictionary where only the keys matter.

In Python, there is a class called "set". I realize that sim开发者_StackOverflow中文版ilar functionality could be implemented in AS by a Dictionary where only the keys matter.

But it seems that this should be a built-in type for ActionScript. Unfortunately, it's nearly impossible to search for. Before I go off and code up my own "set" class, does it already exist?


No, it does not. But you should be careful - relying too much on a user-defined data type (sic) could lead to problems (read: bloated code), eg, if you're accepting varying types as arguments. That said, creating a helper class to deal with Python-like sets is probably the best way to go, though the best way would be likely, as you said, to use objects (Dictionary).

0

精彩评论

暂无评论...
验证码 换一张
取 消