I keep on working in my node-based http server.

I am implementing sessions and, into this, installing code to be executed latter.

So I found a problem and need a bit of inspiration.

The fast way to explain the problem is ask: how can un-bind a variable?

well, I have a function:

function hello()
{
  $server.response.echo("Hi, world!");
  $server.end();
}

First time the page is requested, this function is installed, and second time this functions is executed (both with different response objects).

This doesn't work, but this does:

function hello($server)
{
  $server.response.echo("Hi, world!");
  $server.end();
}

Obviously the problem is the first version of 'hello' store the reference to $server, and the second no, because it is passed as arguments, and bind is delayed.

Its possible to re-bind a code, that is, a function?


My first idea is implement $server (and other globals objects) as pure/complete proxies...

Thanks a lot: Fran.

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to