On Wed, Nov 11, 2015 at 07:53:33PM +0100, Marco van de Voort wrote:
> > I replaced many endangered with-blocks in the LCL.
> > ToDo: check the rest of the Lazarus sources.
>
> Ok, I plan finalizing and committing the trect stuff in the coming week.
The first batch is committed. Tpoint* is
On Wed, Nov 11, 2015 at 10:37:48PM +0100, Bart wrote:
> On 11/11/15, Marco van de Voort wrote:
>
> > Ok, I plan finalizing and committing the trect stuff in the coming week.
>
> Should these be merged to 1.4 fixes branch?
If you want to run 1.4 with trunk yes.
It won't be in
On Sat, 7 Nov 2015 00:21:09 +0100
Marco van de Voort wrote:
>[...]
> Anyway, I hunted down one case by raise tobject.create, and running in the
> debugger, and I committed a fix. The Win32 lazarus now seems to function
> normally at first glance.
I replaced many endangered
My solution is to define my own TRectI type which can implicitly convert
between TRectI <-> TRect. Also I use a TRectF which does the same thing,
but with floats as the dimenions ... MyRectInt := TRectI(MyRectFloat); ...
There is also TPointI and TPointF ...
{ TRectI }
TRectI = record
On Wed, Nov 11, 2015 at 04:39:55PM +0100, Mattias Gaertner wrote:
> >[...]
> > Anyway, I hunted down one case by raise tobject.create, and running in the
> > debugger, and I committed a fix. The Win32 lazarus now seems to function
> > normally at first glance.
>
> I replaced many endangered
On 11/11/15, Marco van de Voort wrote:
> Ok, I plan finalizing and committing the trect stuff in the coming week.
Should these be merged to 1.4 fixes branch?
Bart
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
On Wednesday, November 11, 2015, Bart wrote:
>
> Should these be merged to 1.4 fixes branch?
>
No, Lazarus 1.4 dot versions are released with FPC 2.6.4. The TRect changes
will happen in FPC trunk only.
Juha
--
___
Lazarus mailing
Am 10.11.2015 09:40 schrieb "Jürgen Hestermann" :
>
> Am 2015-11-09 um 14:26 schrieb Sven Barth:
>>
>>
>> > The docs already note that the compiler uses a temporary register
>> > for 'With'.
>> > http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
>> >
Am 2015-11-09 um 14:26 schrieb Sven Barth:
> The docs already note that the compiler uses a temporary register
> for 'With'.
> http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
> Of course if there is no register left the compiler uses the stack.
Please note that this is
On Tue, 10 Nov 2015 12:26:56 +0100
Jürgen Hestermann wrote:
>[...]
> Does that mean, that local variables and with statements are treated
> completely identically?
A local var can be changed. Without optimization the compiler puts the
local var on the stack. With
Am 2015-11-10 um 11:32 schrieb Sven Barth:
The user doesn't need to know the detail that the value is kept in a temporary
register, because that statement by itself is utterly useless for the user, as
on load/store architectures like ARM you /always/ have values in registers if
they are
Am 10.11.2015 12:27 schrieb "Jürgen Hestermann" :
>
> Am 2015-11-10 um 11:32 schrieb Sven Barth:
>>
>> The user doesn't need to know the detail that the value is kept in a
temporary register, because that statement by itself is utterly useless for
the user, as on
Am 10.11.2015 14:37 schrieb "Sven Barth" :
>
> Am 10.11.2015 12:27 schrieb "Jürgen Hestermann" :
> >
> > Am 2015-11-10 um 11:32 schrieb Sven Barth:
> >>
> >> The user doesn't need to know the detail that the value is kept in a
temporary
Am 09.11.2015 13:11 schrieb "Mattias Gaertner" :
>
> On Mon, 9 Nov 2015 10:48:02 +
> Lukasz Sokol wrote:
>
> >[...]
> > Thanks, I believe, this should be added into the docs somewhere ;) if
it's not already there.
>
> The docs already note that
On 07/11/15 11:01, Mattias Gaertner wrote:
> On Sat, 7 Nov 2015 11:39:44 +0100
> Jürgen Hestermann wrote:
>
[...]
>> -
>> with PathArray[High(PathArray)]^ do
>> fillchar(StatisticOfFiles,sizeof(StatisticOfFiles),0);
>>
On 09/11/15 10:19, Mattias Gaertner wrote:
> The above three are not the same.
>
> The second version executes the With-Expression multiple times, so
> unless the compiler optimizes a lot it will create more code and will be
> slower.
>
> The first and third versions have the same amount of
On Mon, 9 Nov 2015 09:38:27 +
Lukasz Sokol wrote:
>[...] On 07/11/15 11:01, Mattias Gaertner wrote:
> > On Sat, 7 Nov 2015 11:39:44 +0100
> > Jürgen Hestermann wrote:
> >
> [...]
> >> -
> >> with
On Mon, 9 Nov 2015 10:48:02 +
Lukasz Sokol wrote:
>[...]
> Thanks, I believe, this should be added into the docs somewhere ;) if it's
> not already there.
The docs already note that the compiler uses a temporary register
for 'With'.
Am 07.11.2015 um 06:40 schrieb Alexander Klenin:
> On Sat, Nov 7, 2015 at 5:58 AM, Florian Klaempfl
> wrote:
>> Am 06.11.2015 um 20:22 schrieb Luca Olivetti:
>>> El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
>>>
You are joking, no? It has been discussed on
Am 07.11.2015 um 06:42 schrieb Ondrej Pokorny:
>
> Do not forget that you can overload operators! In particular you can
> overload the comparison operator to return a record, so your
> "with a=somerecord do" can already be a valid pascal code now:
>
> *type**
> ** TMyRec = record**
> **I:
Am 2015-11-06 um 18:26 schrieb Ondrej Pokorny:
> So yes, let's not use with :)
> ... There is no problem with long variable names at all. There are CodeTools
:)
CodeTools do not help you *read* the code.
I prefer to have this:
-
with PathArray[High(PathArray)]^ do
On Sat, 7 Nov 2015 11:39:44 +0100
Jürgen Hestermann wrote:
>[...]
> CodeTools do not help you *read* the code.
It can help you writing the code more readable and helps to read (i.e.
understand) the code by hints and find declaration.
>[...]
>
On Sat, 7 Nov 2015, Alexander Klenin wrote:
On Sat, Nov 7, 2015 at 5:58 AM, Florian Klaempfl wrote:
Am 06.11.2015 um 20:22 schrieb Luca Olivetti:
El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
You are joking, no? It has been discussed on fpc-pascal/fpc-devel
On Fri, Nov 06, 2015 at 07:25:01PM +0100, Mattias Gaertner wrote:
> > width and height of the trect are assigned instead of the component's ?
>
> Thanks for the hint.
>
> Does Delphi alter some other records too, e.g. TPoint and TSize?
>
> Hint:
> Cody has a tool 'Explode a "With" block':
>
Am 06.11.2015 17:59 schrieb "Marco van de Voort" :
>
> On Fri, Nov 06, 2015 at 05:42:39PM +0100, Michael Van Canneyt wrote:
> > > by Delphi compatibility...
> >
> > Ehm. How can "with" ever be safe ?
>
> Btw the case that I fixed was like this
>
> procedure TSomeForm.Getwind...
>
On 06.11.2015 22:45, Mark Morgan Lloyd wrote:
Luca Olivetti wrote:
with a=somerecord, b=someotherrecord do
begin
a.x:=b.x;
end;
Just because something is 20+ years old doesn't necessarily make it
bad. That syntax looks OK to me (i.e. make a and b look like consts)
but I also find
On Sat, Nov 7, 2015 at 5:58 AM, Florian Klaempfl wrote:
> Am 06.11.2015 um 20:22 schrieb Luca Olivetti:
>> El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
>>
>>> You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
>>> times. An IIRC Italian
El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
times. An IIRC Italian community member then usually shows a syntax
description of a safe "with" statement from a maybe more than 20 year old
pascal dialect.
I don't
On Fri, Nov 6, 2015 at 1:25 PM, Mattias Gaertner
wrote:
>
> Does Delphi alter some other records too, e.g. TPoint and TSize?
>
> It does
http://docwiki.embarcadero.com/Libraries/Seattle/en/System.Types.TPoint
On Friday 06 November 2015 18:19:14 Michael Van Canneyt wrote:
>
> But presumably you mean some construct as
>
> With QMyVeryLongQueyObjectName as Q do
>try
> // Do things with Q
>finally
> Q.Close;
>end;
>
> ?
>
Correct. There have been some more notations suggested.
Martin
On 2015-11-06 17:19, Michael Van Canneyt wrote:
> With QMyVeryLongQueyObjectName as Q do
>try
> // Do things with Q
>finally
> Q.Close;
>end;
var
Q: TQuery absolute QMyVeryLongQueyObjectName;
begin
with Q do
try
// Do things with Q
finally
Q.Close;
On Fri, 6 Nov 2015, Martin Schreiber wrote:
On Friday 06 November 2015 17:42:39 Michael Van Canneyt wrote:
On Fri, 6 Nov 2015, Martin Schreiber wrote:
On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
Nevertheless I am of the opinion that WITH is evil and should be removed
from the
On 06.11.2015 17:42, Michael Van Canneyt wrote:
Ehm. How can "with" ever be safe ?
You can make sure that if some property is ADDED into the with scope, it
doesn't break anything by explicitely using Self (or the unit name or
whatever):
procedure TForm1.DoMySize;
begin
//...
with
On Fri, 6 Nov 2015, Martin Schreiber wrote:
On Friday 06 November 2015 18:33:54 Graeme Geldenhuys wrote:
On 2015-11-06 17:19, Michael Van Canneyt wrote:
With QMyVeryLongQueyObjectName as Q do
try
// Do things with Q
finally
Q.Close;
end;
var
Q: TQuery absolute
On Fri, 6 Nov 2015 16:45:07 +0100
Marco van de Voort wrote:
>[...]
> I yesterday tried to implement some of the TRect helper methods in 3.1.1
>[...]
> I haven't investigated deeper yet, but I suspect the heavy use of WITH in
> interfaces etc is the cause. (if you assign width
@marcov: your patch for this issue in r50234 seems to have mangled
some utf8-codepoints in a comment about Bézier curves (line 2739 and
2749)?
Bart
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
On Friday 06 November 2015 18:33:54 Graeme Geldenhuys wrote:
> On 2015-11-06 17:19, Michael Van Canneyt wrote:
> > With QMyVeryLongQueyObjectName as Q do
> >try
> > // Do things with Q
> >finally
> > Q.Close;
> >end;
>
> var
> Q: TQuery absolute QMyVeryLongQueyObjectName;
>
Am 06.11.2015 um 20:22 schrieb Luca Olivetti:
> El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
>
>> You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
>> times. An IIRC Italian community member then usually shows a syntax
>> description of a safe "with" statement from
On Fri, Nov 6, 2015 at 10:45 AM, Marco van de Voort wrote:
> I haven't investigated deeper yet, but I suspect the heavy use of WITH in
> interfaces etc is the cause. (if you assign width and height of a
> component in a component method in a WITH with a TRECT as argument, then
On 06.11.2015 17:08, Dmitry Boyarintsev wrote:
This is odd. How adding the method to TRect didn't break much for Delphi?
It did break a lot of code for Delphi.
I'd think that Delphi /3d party components code also uses a lot of
WITHs with TRects.
Yes, it did break a lot of code in 3rd
On Fri, Nov 06, 2015 at 11:08:29AM -0500, Dmitry Boyarintsev wrote:
> > I haven't investigated deeper yet, but I suspect the heavy use of WITH in
> > interfaces etc is the cause. (if you assign width and height of a
> > component in a component method in a WITH with a TRECT as argument, then
> >
On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
>
> Nevertheless I am of the opinion that WITH is evil and should be removed
> from the IDE/LCL code (unless only identifiers from within the with
> scope are used; but even then they could be removed...).
Or implement a safe "with" in
On 2015-11-06 16:20, Ondrej Pokorny wrote:
> Nevertheless I am of the opinion that WITH is evil
+1
Especially if you mix more than one scope/variable in the with block.
Regards,
- Graeme -
--
___
Lazarus mailing list
On Fri, 6 Nov 2015, Martin Schreiber wrote:
On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
Nevertheless I am of the opinion that WITH is evil and should be removed
from the IDE/LCL code (unless only identifiers from within the with
scope are used; but even then they could be
On Fri, Nov 06, 2015 at 05:42:39PM +0100, Michael Van Canneyt wrote:
> > by Delphi compatibility...
>
> Ehm. How can "with" ever be safe ?
Btw the case that I fixed was like this
procedure TSomeForm.Getwind...
procedure setwidthheight(const r : TRect); inline;
begin
with R do
begin
On Fri, Nov 6, 2015 at 1:42 PM, Michael Van Canneyt
wrote:
>
>
> On Fri, 6 Nov 2015, Martin Schreiber wrote:
>
>> On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
>>>
>>>
>>> Nevertheless I am of the opinion that WITH is evil and should be removed
>>> from the
On 2015-11-06 16:42, Michael Van Canneyt wrote:
> I use it abundantly. If I have QMYQueryObjectWithAVeryLongName then being
> able to write
Can't you simply use an "absolute" variable, or alias variable with a
shorter name - instead of WITH all together.
I hate WITH, but do use it on occasion -
On 2015-11-06 16:42, Michael Van Canneyt wrote:
> Ehm. How can "with" ever be safe ?
I forgot to add in my previous message... I also can't see how WITH can
ever be made safe.
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
On Friday 06 November 2015 17:42:39 Michael Van Canneyt wrote:
> On Fri, 6 Nov 2015, Martin Schreiber wrote:
> > On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
> >> Nevertheless I am of the opinion that WITH is evil and should be removed
> >> from the IDE/LCL code (unless only
Luca Olivetti wrote:
El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
times. An IIRC Italian community member then usually shows a syntax
description of a safe "with" statement from a maybe more than 20 year old
50 matches
Mail list logo