Questions tagged [let]
In Lisp-like and functional languages, introduces a list of local variables, each (possibly optionally) with its initial value.
745
questions
1
vote
1
answer
35
views
How to make `set!` change the variable in `let` (Scheme)?
Recently when I self-learnt MIT 6.5151 course, I have read SICP 1 to 2.1 as ps0 requires (also read 2.2.1 as CS 61A notes requires) and then Software Design for Flexibility (SDF) Prologue, chapter 1 ...
1
vote
2
answers
27
views
SAS creating global macro and printing it
I am new to SAS environment. I just want to create a global this month variable and print it & use it
in the where condition of data step. My test codes are below:
%macro vars();
%...
2
votes
1
answer
362
views
angular 18 - @let syntax in templates
The Angular team just implemented the new @let syntax in templates. According to this comment it's implemented in this commit, which should already be released in version 18.0.2
I updated my NX ...
1
vote
0
answers
6
views
Is there an R function that minimise a bivariate function f
I need to write a code that using the R function constrOptim, minimise an bivariate function. Please tell me what is wrong in the constrOptim , went i run the code i have this warning message
"...
0
votes
0
answers
43
views
SwiftUI view running twice
I have a view that draws some lines and filled circles. But to know the position of these lines I need to dynamically calculate them as they are being drawn.
I have two issues.
The first is that for ...
0
votes
1
answer
34
views
How to fix SwiftUI: Initializer for conditional binding must have Optional type, not 'ChatMessage' [duplicate]
I am a beginner in SwiftUI and I am trying to create a chat app with firestore. I have this issue and I looked many articles but I can't fix it. I'd be very happy if you help me! Thank you!
My Code:
...
1
vote
1
answer
35
views
Why does declaring a variable without a keyword result in a SyntaxError for var and const, but not for let in JavaScript? [duplicate]
Declaring variable in JS without keyword.
I get SyntaxError when I declare variable like var = 1 or const = 1. But I don't get this error when i declare like let = 1. Why is this happening?
var = ...
2
votes
2
answers
157
views
Performance increase using `let`?
Compare the following two snippets:
expensiveFunction :: [Integer] -> [Integer -> Bool]
expensiveFunction [] = [const False]
expensiveFunction (x:xs) =
let temp = expensiveFunction xs
in [...
0
votes
0
answers
48
views
How to find out how many of each 2, 3 and 4 required to fit in 100 using excel?
I want to determine the numbers or counts of each 2, 3, and 4 required to fit in 100.
I got the formula in Excel which can only return the numbers for two given variables i.e. 2, 3. I want to try for ...
4
votes
1
answer
151
views
How to programmatically expand the let* family of functions in racket
Context
This question is tangentially related to a homework assignment, but I am not looking to have someone do my work for me.
I have an assignment where we are discouraged from overuse of let, let*, ...
1
vote
2
answers
85
views
Trying to get names from a box on the right to automatically appear in another box when a different box has a value in it
hope the title wasn't too confusing.
this is my project:
I'm trying to figure out how to get the names on the right (NICK-GL) to stack on top of each other at the bottom, when one of the mon-fri ...
2
votes
2
answers
76
views
Set variables declared through let* as ignorable
I am trying to write a macro that would generate code that looks like:
(defun test ()
(let* ((_ (exp1))
(_ (exp2))
...
(_ (expn)))))
The (expn) calls might be ...
2
votes
1
answer
89
views
LET with LOOP construct in Common Lisp
I have the following code:
(let (liste (loop for item from 1 to 20 collect item))
(format t "~{~a~}~" liste))
However portacle complains: The variable FOR is unbound. Why?
0
votes
0
answers
39
views
consC in Seasoned Schemer
The seasoned schemer on page 131 and 132 has the below definition of consC and deep.
(define consC
(let ((N 0))
(lambda (x y)
(set! N (add1 N))
(cons z y))))
(define deep
(lambda (...
1
vote
1
answer
269
views
Non-state variable inside SwiftUI View
I just rewatched Demistify SwiftUI and noticed that some of the examples use variable properties inside a SwiftUI View, without using the @State property wrapper. For example (around 19.04):
struct ...