On Mon, 6 Jan 2014 02:14:43 +0500
Ivanko B <[email protected]> wrote:
> lab1.: create; left=10; top=20
> ============================
> It like the TCL, Python etc way. Mainly designed for GUI-progarmming
> w/o any GUI-designer thus with smaller executables.
I think you missed the point. Real pascal programs
are filled with such things: create an object and set
a few properties, even without any GUI involved.
Some real pascal fragments, from lazarus sources:
lhelpcore.pas:
fServer := TSimpleIPCServer.Create(nil);
fServer.ServerID := fServerName;
fServer.Global := True;
fServer.Active := True;
reglazdaemon.pp:
AProject.AddPackageDependency('FCL');
AProject.AddPackageDependency('LCL');
AProject.AddPackageDependency('LazDaemon');
AProject.Title:='Daemon application';
AProject.LazCompilerOptions.Win32GraphicApp:=False;
AProject.ProjectInfoFile:='project1.lpi';
dbexport/...frmmain.pp:
DBFData.Close;
DBFData.TableName:=AFileName;
DBFData.Open;
printers/...winprinters.inc:
PDev:=TPrinterDevice.Create;
PDev.Name :=PPRINTER_INFO_2(InfoPrt)^.pPrinterName;
PDev.Driver:=PPRINTER_INFO_2(InfoPrt)^.pDriverName;
PDev.Port :=PPRINTER_INFO_2(InfoPrt)^.pPortName;
In all these fragments a WITH clause could have helped, but
I can imagine why it was not used. Besides, pascal is the
only language that implements "with", and many people
criticize it. I don't think so, I like "with", but I have
found another paradigm that in many cases is better.
This "colon repetition" is not limited to "with". See
this other example, a set of declarations:
procedure DoSelectDir(Sender: TObject);
procedure DoSaveLayout(Sender: TObject);
procedure ReadConfig; virtual;
procedure WriteConfig; virtual;
which could be written as:
procedure
DoSelectDir(Sender: TObject);
DoSaveLayout(Sender: TObject);
ReadConfig; virtual;
WriteConfig; virtual;
end
In reality, with the different syntax I think of,
this set of declaration would be written like this:
procedure
DoSelectDir of TObject Sender
DoSaveLayout of TObject Sender
virtual
ReadConfig
WriteConfig
end
end
By reducing repetitions, the syntax pushes
toward a more clean and readable source.
Regards,
linuxfan
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk