What does 'let' in swift mean? [closed] - swift

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm learning swift, but i'm not a native english speaker and just want to ask what does 'let' mean? I know its a constant but then why it's not 'cons'?
Is 'let' an abbrevation of some word?
I won't die without knowing it, i'm just curious ;)
Thanks.

There are other languages where let is used as a keyword before a variable declaration, such as BASIC and LISP (or Scheme), and I presume it was taken from there. It's not an abbreviation; it's the normal English word "let", used to introduce a command, as in "Let there be light;" in mathematics it is common to announce a symbol this way, as in "Let x be the unknown number of years we are trying to calculate."
To answer your question a little more fully, though: in my view, there is nothing about this word that makes it particularly suitable for constants. They seems to have made an arbitrary choice. var makes sense for a "variable" that can vary (get it?), so now they just needed another word, and they picked let. Personally, I think const would have been better.

Related

Why we use braces in swift? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Why do we use braces in swift? what is the point of it?
var age=Int.random(in: 1...50)
print(age)
if age>=12 {
print("adult")
} else { print ("child") }
From Mastering Swift 4 - Fourth Edition by Jon Hoffman
In Swift, unlike most other languages, the curly bracket is required after conditional or loop statements. This is one of the safety features that are built into Swift. Arguably, there have been numerous security bugs that may have been prevented if the developer would have used curly braces.

Fast Perl Parser Modules? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
At my work I wrote a little parser for C-like expressions in one of our in-house Perl tools. I initially chose Parse::RecDescent because of its extreme ease of use and straightforward grammar syntax, but I'm finding that it's excessively slow (which is corroborated by general opinion found on the web). It's safe to assume that the grammar of the expressions is no more complicated than that of C.
What are the fastest (but still with a straightforward and uncumbersome grammar format) lexxer/parser modules for the use case of thousands of simple expressions (I'd guestimate the median length is 1 token, mean is 2 or so, and max is 30)? Additionally, thanks to unsavory IT choices, it must work in Perl 5.8.8 and it and any non-core dependencies must be pure Perl.
Parse::Eyapp looks like satysfying 5.8.8, pure perl and dependency requirements. As for speed, it claims LALR parsers, which must be faster than recursive descent. A grammar for expressions is given in the doc. Hope it helps.

Is this a vaild variable name? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
For those that have experience in PowerShell, is this considered to be a valid variable name?
Code:
$[?#+-stuff] is a valid variable name in PowerShell.
It's a valid? Yes, if you wrap it inside curly brackets. This is required because of the special characters.
${[?#+-stuff]} = "foo"
Is it a good name? No. You should keep it simple..
If you made an effort to research it you would have figured it out yourself.
Check of the help documentation the #mjolinor suggested. Especially the part called:
VARIABLE NAMES THAT INCLUDE SPECIAL CHARACTERS
We're all here to help each other, so please show us some respect and behave like a grown-up.

Java Text Preprocessing and Clean-Up [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Could you please recomend me java libraries for text prerprocessing and clean up? The lib should perform such tasks:
convert all verbs to infinitive
convert all nouns to singular form
remove useless (for the sense of a text) words
Converting words to canonical forms (verbs to infinitives and nouns to singular, for example) is called lemmatization. One Java-based lemmatizer is Standford CoreNLP.
For "useless words" you probably want "stop words" - there's no standard list, but there's a lot floating around the Internet which function in more or less the same way with the only difference being how many words they include (typically between 100 and 1000). I've known people to use this list before. When removing stop words, remember to ignore case when looking for matches.
Not sure if this does everything you need, but check out mrsqg.
http://code.google.com/p/mrsqg/

Variable in a Variable iPhone? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
For my iPhone app in objective-c is it possible, and if so how can I make a variable inside a variable?
For example, I have one named Var1 and then I can combine it with Var2. Lets say Var2 is a number, so it displays Var1 like Var11, the second one being Var2. Make sense? Anyway if Im not making sense, could you let me know how a variable in a variable can be done, and used? Thanks.
Are you talking about arrays? Use Arrays.