[Lazarus] 'with' is evil, isn't it?

Sven Barth pascaldragon at googlemail.com
Fri Aug 5 12:44:30 CEST 2011


Am 05.08.2011 12:11, schrieb Max Vlasov:
> But during the research another interesting specie was found.  It's
> called Sun Workshop Pascal Compiler
> http://www.informatik.uni-hamburg.de/RZ/software/SUNWspro/pascal/user_guide/index.html

It's amazing how many Pascal compilers are out there...

> It supports (supported) standard pascal, with some extensions, that is
> made to several language constructions including 'with'
> So on the page
> http://www.informatik.uni-hamburg.de/RZ/software/SUNWspro/pascal/lang_ref/ref_state.doc.html
>
> you can see the following example
>
>      with new_patient: new, old_patient: old do begin
>        new.LastName := 'Smith';
>        new.FirstName := 'Abby';
>        new.Sex := Female;
>        old.LastName := 'Brown';
>        old.FirstName := 'Henry';
>        old.Sex := Male
>      end;
>
> Using ':' looks a little strange, but at least it worked and probably
> didn't conflict with existing syntax.

Not only the ":" look a bit strange (it remembers me a bit of the 
on-clause in except blocks though), but also - and more importantly - 
the order: first the variable or expression that is to be "shortened" 
and then the new identifier for it.

Regards,
Sven




More information about the Lazarus mailing list