- return 'Environment_get(environment, "{}").instance.closure(environment, {}, {})'.format(
- function_call.name,
+ # TODO This gets called twice, which is really inefficient--normalization would also allow other clauses besides a variable reference
+ # TODO This should no longer be called "name", as it can be an expression of a few types
+ # TODO Check the type of the things being called
+ get_closure_clause = generate_expression(function_call.name)
+ return '{}.instance.closure.call(environmentPool, {}.instance.closure.closed, {}, {})'.format(
+ get_closure_clause,
+ get_closure_clause,