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

Max Vlasov max.vlasov at gmail.com
Fri Aug 5 12:11:13 CEST 2011


On Fri, Aug 5, 2011 at 1:29 PM, Sven Barth <pascaldragon at googlemail.com>wrote:

> Am 05.08.2011 11:23, schrieb Luca Olivetti:
>
>  (though it was 20 years ago and I don't remember the exact syntax, I think
>> it was
>>
>>   with a=some.structure,b=some.other.**structure do
>>
>> instead of
>>
>>   with a:=some.structure,b:=some.**other.structure
>>
>> but my memory could be wrong).
>>
>
> Well... if another Pascal dialect had it the changes might be higher that
> it gets integrated into FPC.
>
> So it might be useful to research the exact with syntax of Texas
> Instruments' Pascal.
>
> Regards,
> Sven
>
>

Luca shared an interesting fact, so I tried to find more information. He
probably meant UCSD Pascal, as I see this is a very interesting system,
mentioned also in the lazarus wiki (
http://wiki.freepascal.org/UCSD_Pascal). I downloaded the sources of
the system,  but I could not find the
examples of similar syntax inside many with statements... Maybe there are
other sources.

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 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.

Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110805/613381c6/attachment-0003.html>


More information about the Lazarus mailing list