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

Typeof, Collection as function #28

Open
Artoria2e5 opened this issue Apr 20, 2021 · 0 comments
Open

Typeof, Collection as function #28

Artoria2e5 opened this issue Apr 20, 2021 · 0 comments

Comments

@Artoria2e5
Copy link
Collaborator

Artoria2e5 commented Apr 20, 2021

目前组合拳、载体完全没有出现在语言中,主要是因为 Monkey 本身就没有任何把类型变成字符串的方式。要把这个加进语言,可以:

  • 给个 typeof,返回类型本身的……构造器?
  • 给个 builtin Array(...)(PUA 名组合拳),生成传入参数组成的数组
  • 给个 builtin Hash(...)(PUA 名载体),生成传入参数组成的字典——Hash(99, 1, "a", 2) 就是 { 99: 1, "a": 2 }
  • 构造器提供专门的 fmt::Display,显示其本身的名称
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant