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

deserialize_meta won't union properly #34

Closed
kanghyojun opened this issue Sep 17, 2016 · 1 comment
Closed

deserialize_meta won't union properly #34

kanghyojun opened this issue Sep 17, 2016 · 1 comment
Assignees
Labels

Comments

@kanghyojun
Copy link
Member

https://gitter.im/spoqa/nirum?at=57dd736133c63ba01a0e09e2

@dahlia
Copy link
Member

dahlia commented Sep 18, 2016

@admire93 Although PR #35 fixed it to work, we need to refactor the generated code to be conciser and more efficient than now.

  • The compiler should generate __nirum_type__ = 'union' # or 'record'/'tag'/'enum'/'boxed' so that the runtime can determine what Nirum type the given Python class is generated from.
  • Also, the compiler should generate __nirum_tag_classes__ = {Tag.tag_name: TagName, ...} so that the runtime can lookup the corresponding Python class by the given tag name in O(1). The current implementation loops over cls.__subclasses__() which is O(n).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants