Questions tagged [let]

In Lisp-like and functional languages, introduces a list of local variables, each (possibly optionally) with its initial value.

In Lisp-like and functional languages, introduces a list of local variables, each (possibly optionally) with its initial value. It is illegal to refer to any of the new variables while calculating their initial values ( lets you do that), though in Haskell it is legal (its let is actually letrec).

LET is a special form in Common Lisp, Scheme, Clojure and other Lisp dialects which introduces a list of local variables as pairs of name-value bindings, for use within its body. For instance, in this expression:

(let ((variable1 (+ 1 1)))
  variable1)

variable1 gets bound to the 2 value, and the whole expression returns 2 as a result.

728 questions
0
votes
0 answers

Swift: initialising an instance method using class initialiser and 'let'. Is it correct?

With this simplified Unit class, I have an unset method called myMethod which is initialised when a new instance is created. typealias Converter = (input: Double) -> Double class Unit { let name: String let myMethod: Converter …
Gabriel
  • 27
  • 6
0
votes
1 answer

writing let in vb 2013

I am trying to write Let in VB and it won't let me do it, it keeps erasing itself. Do I need to download a package or something? For example: If Not currentDirectory = "" Then Dim lines() As String =…
user3080143
  • 59
  • 2
  • 6
0
votes
2 answers

JavaScript blockscope with let

I modified the original script from the MDN website given below. What is the type of var? Is the type assigned only after a value is assigned to a variable. Does var b = 1 overwrite the previous statement var b = 10? Or just the variable b? Is let…
wonderful world
  • 10,969
  • 20
  • 97
  • 194
0
votes
1 answer

Scheme let-form

I have the following assignment. In this implementation, you must use let-form to define local name and local procedures for PI, areac, and volumec. The procedures TotalVolume and main remain to be global. I have the program that was created…
Rakeen Huq
  • 37
  • 1
  • 5
0
votes
2 answers

Multiple indirect variables with let command (GNU/Linux Bash)

FontName=Ubuntu FontSize=300 let $FontName$FontSize=21 Getting the value is easy using the following: echo $Ubuntu300 21 However, how can I get the same result using variables? I tried something like: echo ${!FontName!FontSize} but no luck, I…
TuxForLife
  • 219
  • 1
  • 2
  • 15
0
votes
2 answers

How/why is this function legal in OCaml? Also, how would I go about checking if statements like this one are legal in the future?

I'm not sure how to properly go through this function and determine its type. I typed it into an OCaml top level and the output is "hello world" but I do not know why. Could someone please explain how they determined the final output? Thanks! let f…
0
votes
1 answer

racket create function/lambda in let

I'm getting super confused by a function I'm writing in Racket. I may be too used to the let ... in syntax from OCaml. (define/public (get-rects) (let wrap-edge ([(coords '()) (append coords tetramino-wh)]) (case current-type …
eatonphil
  • 13,115
  • 27
  • 76
  • 133
0
votes
2 answers

Xcode 6 - No Visible interface for private members

I have declared private variables in implementation file of cycles. myclass.m @interface myclass() @property (nonatomic) unsigned int number; @end Well, when I put in main.m something like this: myclass * some = [[myclass alloc] init]; [some…
vladimir
  • 11
  • 2
0
votes
1 answer

Vim - How to search and reaplace based on search

What i would like to do : Every time i find something based on s[w|l].*[0-9]\.\* replace the end of that string\search .* with %s/\.\*/\\\\\.\.\*/g Already tried with standard search and replace, but couldn't do it. Thanks
rkpt
  • 39
  • 6
0
votes
1 answer

What is the difference between let and let*, I dont understand this (Racket)

(define x 2) (let ((x 1) (y (+ x 1))) (+ x y)) you get 4; (let* ((x 1) (y (+ x 1))) (+ x y)) you get 3. I do not understand how the let thing works. Could someone please explain, i'm new to computer science thanks
HelpMeplox
  • 21
  • 1
0
votes
1 answer

Visual studio - f# - Error FS0588 : Block following this 'let' is unfinished

my code is the following : type appointment= |Probationary of int |Fixed type GradeLevel = | Junior_Dev of appointment | Dev | Senior_Dev | PM | Architect of int type person = {gradeLevel: GradeLevel ; title: string; salary:…
0
votes
1 answer

Recursive Reassignment of Variables in Clojure

I'm trying to get more acquainted with Clojre so I decided to do my Runge Kutta integrator project in it. However I'm having problems working with the immutable nature of the let statement. I want to evaluate 8 variables in each iteration of the…
apmechev
  • 75
  • 1
  • 8
0
votes
1 answer

Linq error when using let

I have the following linq query and it is giving the following error: A query body must end with a select clause or a group clause from sdc in ScheduleDestinationCaches let twins = from gt in GetTwins(72) join ssFilter in ScheduleStops on…
user1286550
  • 101
  • 1
  • 6
0
votes
1 answer

Using counter each time you run bash script

Imagine I have a directory with these files: file-1.txt file-2.txt ... I want to write a condition for my bash and check if file-2.txt exists then write output to file-3.txt sample bash script file: while read line;do #could…
MLSC
  • 5,872
  • 8
  • 55
  • 89
0
votes
1 answer

VBA Excel - Passing String Arrays to Class Variant type using Get/Let Properties

I have been scouring for an answer to simply pass and return a string array to a class module in vba. Below is my example code. I keep getting the error "Can't assign to array" on the line Orgs.pIDOrgList = ID Any thoughts? Class Code: 'Class…
dankez
  • 345
  • 2
  • 5
  • 16