[fpc-pascal] alias a function + overload 'in'

David Emerson dle3ab at angelbase.com
Mon Dec 19 01:06:01 CET 2011


On Sun 18 Dec 2011, Jürgen Hestermann wrote:
> David Emerson schrieb:
> > 2. is it possible to overload the 'in' operator, so that it may work 
> > (using supplied code) on things that are not a pascal set?
> 
> I do not know whether it is possible but I hate such overloading. An 
> operator defined by the Pascal language should not become a chimera. It 
> destroys the logic of the language. If every identifier and every 
> operator can get an arbitrary meaning then what is the grounding of the 
> language? Hiding details with such mechanism does not help understanding 
> the code, just the opposite.
> 
> Why not simply use a function for such things?

I should know better than to debate this with you, Jürgen, but it's too 
tempting! It's because, to me, Pascal is an extension of mathematics and logic; 
and in the languages of math and logic, such constructs make perfect sense. The 
fact that I cannot use 'in' on certain types of things in Pascal makes it less 
elegant than mathematical language.

But anyway... my guess is that it's not happening anytime soon

~David.




More information about the fpc-pascal mailing list