Skip to content

support nested staging #2

Description

@thautwarm
@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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions