5 ms·
Ditto. Fun fact: various dialects of BASIC let you optionally put LET before your assignment statements. So the following are equivalent: X = 10 LET X
by amyjess 9y ago
Ditto.
Fun fact: various dialects of BASIC let you optionally put LET before your assignment statements. So the following are equivalent:
X = 10
LET X = 10
- joezydeco 9y agoWait...LET was optional? Auigh! Whole months of my childhood, wasted!
- Doctor_Fegg 9y agoDepends on the dialect. It was mandatory on the Sinclair BASICs, for example (ZX81/ZX Spectrum), but optional on the Amstrad (Locomotive/Mallard) and BBC BASICs. A quick search suggests it was optional as early as "MicroSoft"'s Altair BASIC: http://swtpc.com/mholley/Altair/BasicLanguage.pdf http://swtpc.com/mholley/Altair/BasicLanguage.pdf As someone who learned first on a ZX81, I'd always assumed that "LET X=5" was the canonical form, and that "X=5" for assignment was just a shortening for convenience.
- jameshart 9y agoLikewise - but of course in Sinclair BASIC it was mandatory because every command had to begin with a keyword - a fact enforced by the fact that the cursor started out as a flashing [K], and every key on the keyboard was mapped to directly enter a keyword in that mode. LET was on the 'L' key. You literally couldn't type "a = 1" into a Spectrum/ZX81 - you couldn't type an 'a' unless you were at an [L] cursor prompt, which would only appear after you had chosen a keyword. Typing an 'a' at a [K] cursor would get you the keyword NEW. I wonder if you, like me, were also completely thrown when you first encountered a programming language where you didn't also have to enter line numbers...
- feintruled 9y ago> I wonder if you, like me, were also completely thrown when you first encountered a programming language where you didn't also have to enter line numbers... Haha, yes, totally! For me this was AMOS on the Amiga (a Basic variant). I was so thrown I started by using them anyway as they were supported by the interpreter - it just treated them as labels. I soon stopped though when I discovered it didn't reorder based on number, so you ended up with 10 print "world" 5 print "hello" 20 goto 5
- Doctor_Fegg 9y agoNot too thrown - I went from BASIC to Z80 assembler, and that just had labels...!
- deleted 9y ago[deleted]
- Jtsummers 9y agoDepended on the dialect. Whatever we had on my first PC as a kid, it was mandatory. Later, in HS, when we used BASIC for a first CS course, it was optional.
- ghaff 9y agoBASIC on PCs. How new-fangled. I forgot about LET. You probably needed to use it on the HP 2000 minicomputer I first learned BASIC on. :-)
- Someone 9y agoOnly tangentially related: an (unsuccessful) search for a genealogy of the Basic programming language led me to https://en.wikipedia.org/wiki/Basic_Using_Reverse_Polish https://en.wikipedia.org/wiki/Basic_Using_Reverse_Polish, which led me to http://vintagecomputers.site90.net/comp80/ http://vintagecomputers.site90.net/comp80/, which has scans of articles giving examples of that language, for example (from http://vintagecomputers.site90.net/comp80/Part_4_Jul_79.pdf http://vintagecomputers.site90.net/comp80/Part_4_Jul_79.pdf): 018 LET P=P K * B - and 135 LET Q=1 F G / 1 - REC 0.00001 * - Q * but also the sort-of traditional 016 FOR X=1 STEP 1 UNTIL T I guess they had a Basic that only allowed expressions with a single operator or a single function call (some early systems with very limited memory did that) to the right of =, and didn’t have the memory for an infix parser.
- jameshart 9y agoVisual Basic, notably, made 'Let' optional, but made 'Set' mandatory when assigning object references.