lexical-scope
In Ruby, how does one add to an object a method with access to variables in outer scope?
I\'m new to Ruby. I\'m at the stage where I\'m unsuccessfully attempting to write things in Ruby as I would in some other language.[详细]
2023-04-12 16:12 分类:问答What are the new rules for variable scoping in Emacs 24?
Emacs 24 now has lexically-scoped variables. It also still has dynamically-scoped variables, of course. Now that it has both, I\'m quite confused about when a variable will have which kind of scope. T[详细]
2023-04-10 11:54 分类:问答When is it appropriate to set a request-scoped variable in a JSP?
In my experience, it is rarely/never necessary to set scope=\"request\" on an EL variable. For example, I have a page that, given an item parameter, constructs a URL specific to that item based on it[详细]
2023-04-09 06:36 分类:问答Reference counting problem with Perl 5.12.3?
It seems that it\'s cleaning up the pad too early: sub search { my ( $self, $test ) = @_; my $where; my $found= 0;[详细]
2023-03-27 11:49 分类:问答A query about lexical scoping
I try to understand lexical-scoping. In lexical-scoping, I have this code, C like syntax: main{ f1(){ int y = 8;[详细]
2023-03-09 08:05 分类:问答In LISP how to inspect free variables in a closure?
In lisp I can bind free variables bound in a closure like this... (let ((x 1) (y 2) (z 3)) (defun free-variables () (+ x y z)))[详细]
2023-03-09 05:01 分类:问答Perl scoping and the life of local variables
How long does the memory location allocated by a local variable in Perl live for (both for arrays, hashes and scalars)? For instance:[详细]
2023-02-25 12:04 分类:问答Something like let in Ruby
I used to wr开发者_如何学JAVAite let-like expressions -- with lexical scope. So I write my own (sad, but it will fail with multiple threads):[详细]
2023-02-11 05:11 分类:问答JavaScript example question: lexical scoping/closure - Eloquent Javascript
So I\'m new to programming and I\'m trying to learn JS with the book Eloquent Javascript. So far so good, until I reached an example with the following code[详细]
2023-01-24 01:06 分类:问答Why are variables declared with "our" visible across files?
From the "our" perldoc: our has the same scoping rules as my, but does not necessarily create a variable.[详细]
2023-01-14 09:43 分类:问答