Nostalgia – what’s next?
It is easy to feel nostalgic but what I learned back then back in school using Turbo Pascal has formed my whole carrier. I have always liked the Pascal language; I do not know why but I think it is because I feel productive and it is easy to get a grip of the code compared to other languages. (A very subjective, personal opinion – please do not flame me with a language war.)
It is easy when you speak one programming language fluently to look down on other languages and see what is missing in them and what makes your language more high level and effective. But what about the other way around? If you look up at a language that has something that make it more effective and help you develop on a higher level of abstraction. Will you recognise it? Probably not. I guess that most people would have a look at it and disregard it as something strange that you do not need.
I loved when the Pascal language was extended with objects in back in Turbo Pascal 5.5 but it took a while of study and thinking before I got it. We have made a lot of improvements over the years (and I like all of them except nested types which I think looks ugly, it does not feel right).
So what is the next major improvement of Object Pascal going to be? If I could decide I would have a look at one of the cool features of Lisp – closures.
How could that look like in Pascal? Procedural types can already be used to pass along a pointer to a function but passing a pointer to a local procedure to a procedure variable will not be accepted by the compiler today.
ثنائية الخيار آلة حاسبة procedure doThreetimes( P: TProcedure ); opzioni binarie casalinga di roma begin P; P; P; dinero facil opciones binarias end; binary trader robot procedure Count; investimenti opzioni binarie var n: indicazioni opzioni binarie integer; siti operazioni binarie iq procedure add1; opcje binarne darmowy depozyt begin n := n + 1; auto pozioni binarie com end; köp Viagra 150 mg master begin n := 0; doThreeTimes( add1 ); WriteLn( n ) // here n is 3 24option demokonto end;
Another way could be to pass anonymous functions.
www opzioni binarie demo procedure doThreetimes( P: TProcedure ); binÃÂÃÂÃÂÃ¢ÂÂÃÂÃ¢ÂÂÃÂÃÂ¤re optionen anfÃÂÃÂÃÂÃ¢ÂÂÃÂÃ¢ÂÂÃÂÃÂ¤nger begin P; P; P; anyoption betrug end; fincar without prescription procedure Count; autopzionibinarie esempi var I: integer; forex italia opinioni begin I := 0; doThreeTimes( الخيارات الثنائية مزايا التداول procedure(); begin I := I + 1; end; ); WriteLn( I ) // here I is 3 end;
Or maybe like this:
procedure TForm1.FormCreate(Sender: TObject); begin Button1.OnClick := procedure(); begin Self.Caption := 'New Form Title'; end; end;
So what would you choose to improve in Object Pascal if you could decide for yourself?