Some might enjoy this history of Basic.
I was just thinking about the LET statement this morning
I learned BASIC on a teletype with paper tape reader and punch in a tiny closet next to my high school algebra teacher’s room. I was a middling student in the regular curriculum but she must have seen something in me and gave me a key to the room and unlimited access to the terminal, which was connected via acoustic modem to a PDP-11 at the University of Deleware.
LET is still used today in other languages.
In Swift it is used to declare a non-mutating property or class, while VAR is used to declare a mutating property or class.
You can do conversion between mutating and non-mutating by re-declaring the property / object.
You can also use it ensure an object isn’t nil.
var kickAssString = "Hello World" // --- Mutable.
// --- do things here.
let kickAssString = kickAssString // --- Now it's non-mutable and can't be edited.
// --- Using Let to ensure object/property isn't nil.
if let kickAssString = someDictionary[ someKey ] {
// --- do things with kickAssString, but you can't edit it.
} else {
// --- Dictionary doesn't contain someKey or the value/object is NIL.
}
LET was present in a mainstream BASIC language as recently as VB6, although it was entirely optional for variable assignment. It basically was ignored by the compiler.
Not to be confused with Property Let, which was pretty important.