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

support nested staging #2

Open
thautwarm opened this issue Jul 26, 2018 · 0 comments
Open

support nested staging #2

thautwarm opened this issue Jul 26, 2018 · 0 comments

Comments

@thautwarm
Copy link
Owner

@feature(const, constexpr)
def f():
   x: const = 1
   def g():
       return x 
  return g()

f()()

The above codes raise NameError now for constant symbol x doesn't exists here.

In the very first beginning I've made a decision that not allow to affect the nested sub-closures in a featured closure(which means the function annotated by @feature(xxx)). However I just found some use cases and if I don't make it possible to inherit further effects from a featured closure.
The only way now to make general constants(in Python it stands for a constant which could be made from a variable.) have to be performed in runtime which costs heavily. For applying deep bytecode optimization now I think there should be a way for nested closures to inherit effects from featured closure.

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