On 22/09/2026 18:50, Stefan Ram wrote:
> Johann 'Myrkraverk' Oskarsson <joha…@myrkraverk.invalid> wrote or quoted:
>> the book talks about shadowing variables, with a completely new type.
>
> The Rustafarians think that
>
> let input = input.trim();
>
> is clearer, because the name "input" always represents the same
> concept, and it becomes impossible to inadvertently use the un-
> trimmed input later. (One also might think of every "let" in a
> block opening a kind of "new scope".)
In fact it's the semi-colon doing that isn't it? Following the age-old
form of so many languages in which (pseudo-grammar):
implicit-scope : statement ';' implicit-scope
| statement ';'
'let' just takes advantage of the new implicit-scope to cons a
dictionary overlay (or in this case an individual identifier definition)
onto a definitions dictionary stack at compile time (if you view a
compiler as an interpreter that compiles instead of executing).
--
Tristan Wibberley
The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.