Skip to main content
Filter by
Sorted by
Tagged with
3 votes
4 answers
140 views

I am writing a Blazor component and noticed something unexpected. In my Razor code, I use a foreach to loop over a list, and inside the Click event handler of a RadzenButton I declare another foreach ...
Colin's user avatar
  • 41
2 votes
1 answer
175 views

This is one question encountered while reading the answer of this QA (as ikegami's comment says, how subroutine foo works is complicated. IMHO that may be due to using one outside variable): sub foo { ...
An5Drama's user avatar
  • 774
-1 votes
1 answer
43 views

consider the nested functions: def a(): def b(): def c(): def d(): def t(): I know: t can call a and vv a can also call b and d b can call d, a and c d can call b and a c can call b ...
kiyo-koji's user avatar
-1 votes
1 answer
65 views

I'm currently taking a course about programming languages and trying to solve the following question, given the code in SML syntax, assume SML using dynamic scoping, what would be the value of the ...
Newlearner826's user avatar
0 votes
0 answers
50 views

A while ago I found this answer by Shepmaster about how to implement cleanup code at the end of a Rust test. I added my own "generalised" idea from his, here. It's been running fine as ...
mike rodent's user avatar
  • 16.1k
0 votes
1 answer
74 views

So I'm fairly new to all this. I've got the beginnings of a simple Octree implementation for a Unity project. This consists of an Octree parent class, an instance of it, and a OctreeNode subclass I'm ...
Ferrick's user avatar
3 votes
1 answer
661 views

I'm having a hard time with how Rust defines "scope". Or perhaps it's with the definition of "scope" in the No Starch Press book (I actually bought the book). On the top of pg. 62:...
mnemotronic's user avatar
  • 1,046
0 votes
1 answer
49 views

I'm having trouble understanding why this piece of R code works the way it does. Here is a simple function: weird_ls <- function() { some_env <- new.env() assign("a", value = 1, ...
weakCoder's user avatar
0 votes
2 answers
81 views

I'm using MIME::Parser to parse a bunch of emails. I want a different subdirectory for every mail message, with consistent file naming within each subdirectory. So far so good, but there's a couple ...
thomasafine's user avatar
0 votes
0 answers
119 views

I am trying to pass a closure which captures a local variable: fn main() { /* snip */ let COINT = some_function_call(); /* snip */ hermes.with_task( u32::MAX, 1, 1, Box::...
Plegeus's user avatar
  • 402
2 votes
2 answers
76 views

(I have this uneasy feeling that I've asked this before, but now I can't find it. Feel free to close and redirect this question if so...) In C, assume I have a function named thing() and some other ...
fearless_fool's user avatar
2 votes
1 answer
84 views

I'm trying to use std::size instead of macros like _countof or ARRAYSIZE, but I'm running into scoping problems. Is the following code legal? #include <iterator> int main() { int arr1[4]; ...
user541686's user avatar
  • 212k
0 votes
0 answers
163 views

There are a lot of questions and answers about conflicting variables names on Stackoverflow, but they all seem to be about scoping in your own code. <script src="https://external_one/...
Jasper's user avatar
  • 630
0 votes
1 answer
125 views

I'm trying to determine the best way to allow a user to pass a class's method into a promise chain. Currently the code looks like this, and I get the error I expect. class Parent { async say(...
dragonmantank's user avatar
0 votes
1 answer
309 views

Let's say I create a function: x = function() { print(environmentName(environment())); envir=environment(); print(envir); print(environmentName(envir)); print(environmentName(environment())); print(...
mshaffer's user avatar
  • 1,013
0 votes
1 answer
92 views

(output printed is written in comment) Just by giving int data type of the variable y which is within the paranthesis the output is different in program 2. How Memory allocation in stack segment will ...
Abhay's user avatar
  • 1
0 votes
1 answer
46 views

I'm working on a standard Rails app that uses a mailer to send email. Each mailer class has an attachments attribute [src on GitHub] that aliases an instance variable. I'm trying to pass that ...
duhaime's user avatar
  • 27.9k
0 votes
0 answers
302 views

I'm trying to have a shared store of global variables in a Vue.js application. Since only some properties are relevant to the state of the actual application, only those are wrapped in a Vue ...
Marcus K's user avatar
2 votes
1 answer
131 views

I try to embed cca (and also capscale) from package vegan (version 2.5-7, R 4.1.2) in another function to test an analysis pipeline with some data transformation and then varying model formulas. The ...
tpetzoldt's user avatar
  • 5,838
1 vote
1 answer
57 views

I'd like to feed a value from one function into another that I'm calling on inside the first, and I can't seem to get the scoping right. Crucially, the two functions are defined separately. Here's an ...
shirewoman2's user avatar
  • 1,960
0 votes
0 answers
763 views

I just have a problem with C dynamic scoping in the following code. I am aware that C only uses static (lexical) scoping, but the problem asks to pretend that we are using dynamic scoping. #include &...
John Lozenro's user avatar
0 votes
4 answers
1k views

I want to remove the throws FileNotFoundException from the method head and put it into it. public static String[] read(String file) throws FileNotFoundException { But then I can't access in (the ...
hallopeterswelt's user avatar
0 votes
3 answers
196 views

I have a variable let second = 20 that i make 1 lower until it hits 0. When it hits 0 i want to stop running a part of my code but the variable second is always 20 when i use it because i make it ...
Tibo Mertens's user avatar
0 votes
0 answers
19 views

I have read that in sloppy mode function declarations are function scoped just like var with value of actual functions. But I want to know why can't I access the inside() function code below: ...
Talha Ali's user avatar
2 votes
1 answer
215 views

Hey guys can someone just quickly help me out here. I have an interval for a slideshow in one function and I want to clear it from another function without using global scopes as I know it is bad ...
justaguy's user avatar

1
2 3 4 5
12