lexical-scope Questions
2
Solved
Basically I am going through the definition of closure functions which says -
A function that can be referenced with access to the variables in
its lexical scope is called a closure
So I want to ...
Aconcagua asked 3/3, 2020 at 8:47
22
Solved
What is a brief introduction to lexical scoping?
Sundae asked 26/6, 2009 at 5:10
7
Solved
I just finished reading about scoping in the R intro, and am very curious about the <<- assignment.
The manual showed one (very interesting) example for <<-, which I feel I understood....
Derryberry asked 13/4, 2010 at 10:4
3
Solved
[NOTE: I asked this question based on an older version of Rakudo. As explained in the accepted answer, the confusing output was the result of Rakudo bugs, which have now been resolved. I've left th...
Polypary asked 18/9, 2021 at 4:10
2
Solved
I've read a couple of more comprehensive articles on the execution context and now I am sort of confused and messed up in the head.
To keep the question as brief as possible avoiding long citations...
Elwaine asked 24/10, 2020 at 10:58
4
In many functional programming languages, it is possible to "redefine" local variables using a let expression:
let example =
let a = 1 in
let a = a+1 in
a + 1
I couldn't find a built...
Supermundane asked 15/10, 2020 at 16:5
2
Solved
I'm writing a module for creating enums with custom behaviour. What I do at the moment is add the enum to the GLOBAL package, but that doesn't install any lexical symbols unless you create the enum...
Vincenz asked 18/3, 2019 at 19:2
1
Solved
I am currently working my way through Graham's On Lisp and find this particular bit difficult to understand:
Binding. Lexical variables must appear directly in the source code. The
first argume...
Lemuellemuela asked 12/3, 2018 at 21:53
2
Solved
Through learning R, I just came across the following code explained here.
open.account <- function(total) {
list(
deposit = function(amount) {
if(amount <= 0)
stop("Deposits must be pos...
Klinges asked 2/3, 2017 at 15:57
1
Solved
When an eval statement is within the scope of a lexical variable, that variable should be within the lexical context of the evaluated block. Moreover, lexical variables should be available in the...
Consumerism asked 5/10, 2017 at 15:51
1
Solved
Looking at the source for Int, I see that all of the classes are declared with my, which I would have thought would make them private and not available outside that file. But, they obviously are. W...
Valued asked 12/6, 2017 at 22:31
3
I know that 'this' in JavaScript has a different meaning than in in TypeScript, as per this article 'this' in TypeScript. I have the following code in JavaScript used to create a thicker stroke on ...
Disease asked 21/4, 2017 at 19:16
3
Solved
I have never been able to come up with a method to penetrate the set-process-sentinel hierarchy with let-bound variables defined at the outset of the function -- only buffer-local or global variabl...
Gonfalonier asked 3/7, 2014 at 8:22
2
Solved
I was looking in and saw this comment in the indir implementation:
sub indir(Str() $path, $what, :$test = <r w>) {
my $newCWD := $*CWD.chdir($path,:$test);
$newCWD // $newCWD.throw;
{
m...
Fleurdelis asked 31/12, 2016 at 9:1
2
Solved
function buildList( list ) {
var i = 0;
var first = function () {
console.log( "in" )
console.log( i );
}
var Second = function () {
console.log( "out" )
first();
}
return Second;
}
va...
Browder asked 23/12, 2016 at 7:48
2
Solved
ES5 changed variable object(VO) to lexical environment. What's the motivation of such change since VO is already very obvious as perception?
Minardi asked 11/11, 2016 at 9:20
0
Can someone give me explanation for the below sentence highlighted in Bold.
"Primitive functions are only found in the base package, and since they operate at a low level, they can be more efficie...
Irrepressible asked 2/7, 2016 at 9:0
1
Some related posts I've found:
go variable scope and shadowing
Golang: variable scope inside if statements
Limit the scope of variables storing error
Also there are many use cases to Variabl...
Cyst asked 11/4, 2016 at 15:37
2
Solved
I'm trying to write a simple script that uses threads and shares a variable, but I don't want to make this variable global to the whole script. Below is a simplified example.
use strict;
use warni...
Tabathatabb asked 8/10, 2015 at 15:57
3
Solved
It seems to be a commonplace that accesses to lexical scope can be worked out at compile time (or by a static analyzer, since my example is in Python) based simply on location in the source code.
...
Phyllida asked 22/9, 2015 at 21:51
2
Solved
I have the following ES6 code using a fat arrow function:
var test = {
firstname: 'David',
fn: function() {
return ['one', 'two', 'tree'].map(() => this.firstname)
}
}
console.log(test.fn()...
Airhead asked 19/1, 2015 at 16:42
2
Solved
While looking into ES6 arrow functions' documentation on Mozilla documentation, I got to know that Arrow functions applies all the rules of strict mode, except one as described in the link
...
Apodosis asked 8/6, 2015 at 6:34
1
Solved
I've looked at the other lexical scoping questions in R and I can't find the answer. Consider this code:
f <- function(x) {
g <- function(y) {
y + z
}
z <- 4
x + g(x)
}
f(3)
f(3) w...
Streaming asked 14/4, 2015 at 17:44
2
Solved
Normally I'd assign an alternative "self" reference when referring to "this" within setInterval. Is it possible to accomplish something similar within the context of a prototype method? The f...
Scandian asked 25/10, 2011 at 14:15
6
Solved
I'm new to Scheme and trying to understand how certain values that appear within a function can persist across multiple uses. Take the following counter:
(define count
(let ((next 0))
(lambda ()...
Besse asked 31/5, 2012 at 17:9
1 Next >
© 2022 - 2025 — McMap. All rights reserved.