3 ms·
Pascal (https://www.freepascal.org/docs-html/ref/refsu62.html https://www.freepascal.org/docs-html/ref/refsu62.html) and Visual Basic (https://docs.microsoft.co
by Someone 5y ago
Pascal (https://www.freepascal.org/docs-html/ref/refsu62.html https://www.freepascal.org/docs-html/ref/refsu62.html) and Visual Basic (https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/with-end-with-statement https://docs.microsoft.com/en-us/dotnet/visual-basic/languag...) have with.
That serves a similar purpose, (in VB only for accessing multiple fields in an object, I think)
Visual Basic’s syntax is a bit safer. Requiring that seemingly superfluous dot means there can’t be confusion between referencing fields and referencing local or global variables.
In Pascal adding a field to a record whose name shadows that of a local can change the meaning of the statements in a with statement, and removing it may silently ‘fix’ a broken reference to a no longer existing field.
with A, B, C, D do is asking for trouble even more.