lexical-closures

How to implement closures without gc?

I'm designing a language. First, I want to decide what code to generate. The language will have lexical closures and prototype based inheritance similar to javascript. But I'm not a fan of gc and try to avoid as much as possible. So the question: Is there an elegant way to implement closures without resorting to allocate the stack frame ...

Scope of python lambda functions and their parameters

I need a callback function that is almost exactly the same for a series of gui events. The function will behave slightly differently depending on which event has called it. Seems like a simple case to me, but I cannot figure out this weird behavior of lambda functions. So I have the following simplified code below: def callback(msg): ...

Is this scoping possible in javascript?

I am working on a javascript framework. I have several independent scripts that look like this: core.modules.example_module = function(sandbox){ console.log('wot from constructor ==', wot); return{ init : function(){ console.log('wot from init ==', wot); } }; }; this function is called from another external scri...

Lexical closures over macrolet?

Is there a way to do something like lexical closures using macrolet? What I want to do is make the following macro a local recursive helper that calls a function on each combination instead of generating a list as it does now calling the macro in the repl results in: CL-USER> (combinations nil '(1 2 3) '(4 5 6)) ((1 4) (1 5) (1 6) (2 4...