News for hackers. Stuff that matters.
Re:Why Use Pascal? by zabzonk on Sunday July 09, 2023 @04:55AM (#36652849)
this post is specifically about pascal - my comment about {} vs begin...end was intended for that context. pascal has no way of defining variables within a local scope - it was added to delphi as a kludge much later. i admit i should have said something like "... {} in C and C++".
Re:Why Use Pascal? by hnlmorg on Sunday July 09, 2023 @05:43AM (#36653056)
> this post is specifically about pascal - my comment about {} vs begin...end was intended for that context

That link was Pascal. It was just one of many dialects of Pascal.

> pascal has no way of defining variables within a local scope

I just did a quick search and turns out Pascal does support nesting variable scopes too.

> it was added to delphi as a kludge much later

Is it a kludge though? Or are you just calling it that because it disproves your point? The syntax is pretty similar to a lot of C-like languages. So you’d be calling their variable declarations a kludge too.

It feels like you’re being overly dismissive.

> i admit i should have said something like "... {} in C and C++".

it certainly would have helped your case to have opened with a little more context rather than assuming other people don’t understand how scoping works ;)

But even that aside, Pascal does support scoping inside compound statements.

Begin End and {} are just tokens to denote the start and end of a compound statement. Just like how Python uses indentation to group compounds.

Everything else you put is missing the point about how language grammar is parsed.

Re:Why Use Pascal? by Lerc on Sunday July 09, 2023 @07:37AM (#36653643)
Well the good thing about this thread is that I found out that Pascal has grown inline vars since I last used it. With type inference too by the looks of it.

Maybe I will make my way back after all.