Click here to Skip to main content
15,910,661 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Mike Hankey19-May-24 10:41
mveMike Hankey19-May-24 10:41 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
trønderen19-May-24 11:58
trønderen19-May-24 11:58 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Richard Andrew x6419-May-24 12:13
professionalRichard Andrew x6419-May-24 12:13 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
trønderen19-May-24 12:11
trønderen19-May-24 12:11 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ralf Quint20-May-24 10:14
Ralf Quint20-May-24 10:14 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
trønderen20-May-24 14:44
trønderen20-May-24 14:44 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ralf Quint20-May-24 16:48
Ralf Quint20-May-24 16:48 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
trønderen21-May-24 4:12
trønderen21-May-24 4:12 
Ralf Quint wrote:
Very interesting that you are trying to explain how Pascal works to someone who is programming in various versions of Pascal, as the main programming language, for 48 years now.
I did not intend my post an answer to you personally, but as a post available to the general public. The majority of CP readers are unfamiliar with the semantics of Pascal "with" - a great deal haven't even worked much with statically nested scopes in any sense. Your profile doesn't tell that you have been programming Pascal for 48 years, so I couldn't possibly have adapted my post to that!
within the nested WITH statements (regardless of how you write it), it IS POSSIBLE to create an unintentional ambiguity
Are you saying that it not only is POSSIBLE, but you did it? You claim that there is 'an unintentional ambiguity', but I see none.
which is NOT guaranteed to be always have the same precedence
What are you saying here? That you have been working with Pascal compilers that did not create an inner scope for B with the short form ("with A, B do")? Did that compiler claim to be conformant to the language standard?

If there were an ambiguity, then there would be two different ways to interpret the semantics of the statement (here: "C:= 1;"). Some Pascal compilers would select one semantic, others would select the other. If you claim that you have seen both, in different Pascal implementations, I would sure like to hear which they are, and which one provides which semantics. Also, I'd like to know if they both claim standard conformance. I am quite sure that they both could!
it clearly shows that you have not worked with a lot of different Pascal implementations
Only about half a dozen, on VAX, CDC, ND, IBM, MC68 and x86 machines. It is long ago, so they were all Pascal compilers, and
Pascal
calling methods of the same name in different objects, so something like

with A, B do
begin
C ("foo");
C ("bar");
end;
was not a valid syntax - plain Pascal doesn't have objects, only records, and you cannot "call methods in different objects".

Original Pascal was a well defined, consistent language, defined by people who knew how to define unambiguous grammars. A couple years later, a more successful competitor, as it turned out, was created by people who certainly did not master formal language grammars to the same degree. They were not alone - defining (or extending) good formal languages require experts. Lots of programming languages are defined by people who are not top experts.

I would not be surprised if some of the object extensions of plain Pascal were defined by people who were trying to transfer ideas from competing languages defined by people with less competence in good language design. Maybe that could introduce some ambiguity into the extended language. And, if two independent groups made two independent extensions of the language (effectively creating two languages), they might of course create extensions with differing semantics. That doesn't introduce an 'ambiguity' in the original Pascal!
And the application of scopes within nested procedures/functions, that is completely different issue. THAT is clearly defined.
I have been studying only a single Pascal compiler (the FOSS compiler from ETH). That one most certainly used exactly the same inner mechanism for entering an inner scope, whether nested procedures or nested "with" - an array of trees of symbol definitions, with a global index telling which is the current innermost scope. When the parser encounters a symbol, it searches the trees one by one, starting at the highest valid index (the current scope), working backwards through the trees until a definition is found. This is done in one way, identical for record fields, function names or variable names. So it is not 'a completely different issue'.
But that would be also not related to the initial post of this thread.
Which may be why I answered to a post in a branch, not directly to the OP. But, the original post was about Pascal "with". Pascal "with" is about scoping, more or less by definition. So we are not that far off track!
Religious freedom is the freedom to say that two plus two make five.

GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ralf Quint21-May-24 6:18
Ralf Quint21-May-24 6:18 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
trønderen21-May-24 6:51
trønderen21-May-24 6:51 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Peter Turtle19-May-24 21:47
professionalPeter Turtle19-May-24 21:47 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
0x01AA20-May-24 0:25
mve0x01AA20-May-24 0:25 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Peter Turtle20-May-24 2:25
professionalPeter Turtle20-May-24 2:25 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Al Gonzalez20-May-24 6:46
Al Gonzalez20-May-24 6:46 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
0x01AA20-May-24 7:06
mve0x01AA20-May-24 7:06 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ralf Quint20-May-24 8:41
Ralf Quint20-May-24 8:41 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ravi Bhavnani20-May-24 14:53
professionalRavi Bhavnani20-May-24 14:53 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
0x01AA21-May-24 8:26
mve0x01AA21-May-24 8:26 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
jschell21-May-24 12:44
jschell21-May-24 12:44 
GeneralWordle 1,065 Pin
StarNamer@work18-May-24 13:32
professionalStarNamer@work18-May-24 13:32 
GeneralRe: Wordle 1,065 Pin
Sandeep Mewara18-May-24 17:09
mveSandeep Mewara18-May-24 17:09 
GeneralRe: Wordle 1,065 Pin
OriginalGriff18-May-24 20:01
mveOriginalGriff18-May-24 20:01 
GeneralRe: Wordle 1,065 Pin
Amarnath S18-May-24 20:10
professionalAmarnath S18-May-24 20:10 
GeneralRe: Wordle 1,065 - 5 4 me shoulda been 3 Pin
pkfox18-May-24 21:09
professionalpkfox18-May-24 21:09 
GeneralRe: Wordle 1,065 Pin
Cp-Coder19-May-24 2:21
Cp-Coder19-May-24 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.