<div dir="ltr"><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 22, 2015 at 7:47 PM, Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><p>
> I'm not a compiler programmer, but it almost seems like laziness that the second case is not possible already? Maybe something is really hard with multi-word operators?</p>
</span><p>The compiler is geared towards single word operators (combined with their precedence).</p></blockquote><div>Is it technically infeasible to expand this to two-word operators? SQL did it.. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<p>> Convenience should be added to this. Take for example type inference. If the compiler can easily figure out the type of a result, why should I have to declare a variable first with the appropriate type? Of course that means to allow var declarations inside the code block. Something I've always wanted to see in Pascal since my brief stint with C++ in the early 90s. The standard argument against is probably "that is unPascallish" or that it is moving away from strong typing. I disagree: if the compiler can figure things out before runtime you still have strong typing. So, for example, I would like to declare something like this anywhere inside a begin..end block:<br>
><br>
> var A := SomeClassInstance.SomeFunction;</p>
</span><p>While I agree that type inference /might/ be useful I don't agree with inline variable declarations. One of the main points of Pascal is declare before use. While this is somewhat violated with Delphi compatible generics there one could at least argue that the specialized type is implicitly declared by the generic declaration...</p></blockquote><div>I have never managed to understand why "declare before use" is so important to Pascal. I get the bit about strong typing and doing everything possible to eliminate errors at compile time, but I still don't get why. If this is central to what makes something "Pascal", I would love to be pointed to a good explanation. I'm not trying to be a pain here. I've been programming in Pascal, full time, for most of my life. It has always puzzled me why everything has to be declared first. </div><div> </div></div></div></div>