(tout excusé!)
Em 17.09.2014 21:45, Flávio Etrusco escreveu:
> On Wed, Sep 17, 2014 at 4:38 AM, Frederic Da Vitoria
>
wrote:
>
>> 2014-09-17 3:11 GMT+02:00 Flávio
Etrusco :
>>
>>> On Tue, Sep 16, 2014 at
8:09 PM, Philippe wrote:
>>>
on compiler
implementation: I read in this
On Wed, Sep 17, 2014 at 4:38 AM, Frederic Da Vitoria
wrote:
> 2014-09-17 3:11 GMT+02:00 Flávio Etrusco :
>>
>> On Tue, Sep 16, 2014 at 8:09 PM, Philippe wrote:
>> > on compiler implementation:
>> >
>> > I read in this list that the group lost months due a "with" problem.
>> >
>> > People use "wit
2014-09-17 3:11 GMT+02:00 Flávio Etrusco :
> On Tue, Sep 16, 2014 at 8:09 PM, Philippe wrote:
> > on compiler implementation:
> >
> > I read in this list that the group lost months due a "with" problem.
> >
> > People use "with", and I guess lot of people use it!
> >
> > I checked the reference
>
sorry ... hijacking is not my intention ... sorry.
Em 16.09.2014
22:11, Flávio Etrusco escreveu:
> On Tue, Sep 16, 2014 at 8:09 PM,
Philippe wrote:
>
>> on compiler
implementation: I read in this list that the group lost months due a
"with" problem. People use "with", and I guess lot of pe
On Tue, Sep 16, 2014 at 8:09 PM, Philippe wrote:
> on compiler implementation:
>
> I read in this list that the group lost months due a "with" problem.
>
> People use "with", and I guess lot of people use it!
>
> I checked the reference
> http://www.freepascal.org/docs-html/ref/refsu58.html#x155-1
on compiler implementation:
I read in this list that the group
lost months due a "with" problem.
People use "with", and I guess lot
of people use it!
I checked the reference
http://www.freepascal.org/docs-html/ref/refsu58.html#x155-16500013.2.8
and there is not any warning ... just:
The
On Mon, Sep 15, 2014 at 2:55 AM, Sven Barth wrote:
> On 14.09.2014 18:05, Philippe wrote:
>>
>
> Take this example:
>
> === code begin ===
>
(...)
>
> procedure TestWith;
> var
> p: PTest;
> begin
> New(p);
>
> with p^ do begin
> Prop1 := 42;
> Prop2 := 21;
> end;
>
> Dispose(p);
On 09/16/2014 03:41 PM, Philippe wrote:
>
> I imagine that who really want to get rid from the hint ... don´t use
> Pascal anyway! or do have strong test tools!!!
>
> one point is that (many?) people use "with" ... and compiler can make
> it safer. may be as described Frederic Da Vitoria ... produc
I imagine that who really want to get rid from the hint ... don´t
use Pascal anyway! or do have strong test tools!!!
one point is that
(many?) people use "with" ... and compiler can make it safer. may be as
described Frederic Da Vitoria ... producing error when may be confused.
(but let config
2014-09-16 14:42 GMT+02:00 Sven Barth :
> Am 16.09.2014 12:37 schrieb "Mattias Gaertner" >:
> >
> > On Tue, 16 Sep 2014 07:26:24 -0300
> > Philippe wrote:
> >
> > >
> > >
> > > could the compiler avoid "with" pitfalls?
> > >
> > > now the compiler attach
> > > a property to the closest "with" wh
Am 16.09.2014 12:37 schrieb "Mattias Gaertner" :
>
> On Tue, 16 Sep 2014 07:26:24 -0300
> Philippe wrote:
>
> >
> >
> > could the compiler avoid "with" pitfalls?
> >
> > now the compiler attach
> > a property to the closest "with" where it finds it.
> >
> > the compiler could
> > check if the prop
Il 16/09/2014 12:26, Philippe ha scritto:
could the compiler avoid "with" pitfalls?
The "with" construct can be very handy, but should be used with caution,
like a lot of other constructs, declarations, etc. E.g. for symbols
present with the same name in different units, depending on the o
2014-09-16 12:36 GMT+02:00 Frederic Da Vitoria :
> 2014-09-16 12:26 GMT+02:00 Philippe :
>
>> Em 16.09.2014 05:44, Frederic Da Vitoria escreveu:
>>
>> 2014-09-14 16:23 GMT+02:00 Mark Morgan Lloyd <
>> markmll.fpc-pas...@telemetry.co.uk>:
>>
>>> I'd be far happier if there were provision for decl
On Tue, 16 Sep 2014 07:26:24 -0300
Philippe wrote:
>
>
> could the compiler avoid "with" pitfalls?
>
> now the compiler attach
> a property to the closest "with" where it finds it.
>
> the compiler could
> check if the property appears in another "with" of the "with" stack and
> produce a
2014-09-16 12:26 GMT+02:00 Philippe :
> Em 16.09.2014 05:44, Frederic Da Vitoria escreveu:
>
> 2014-09-14 16:23 GMT+02:00 Mark Morgan Lloyd <
> markmll.fpc-pas...@telemetry.co.uk>:
>
>> I'd be far happier if there were provision for declaring a temporary
>> "shortcut" symbol:
>>
>> with shortcut
could the compiler avoid "with" pitfalls?
now the compiler attach
a property to the closest "with" where it finds it.
the compiler could
check if the property appears in another "with" of the "with" stack and
produce a message (hint, warning or error, which may be configurated).
is not it
2014-09-14 16:23 GMT+02:00 Mark Morgan Lloyd <
markmll.fpc-pas...@telemetry.co.uk>:
> I'd be far happier if there were provision for declaring a temporary
> "shortcut" symbol:
>
> with shortcut: TSomething= TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]^ do
>begin
>shortcut.DirLogged
On 13 September 2014 20:29, vfclists . wrote:
>
>
> On 13 September 2014 20:02, Sven Barth
> wrote:
>
>> On 13.09.2014 20:13, vfclists . wrote:
>>
>>> According to the docs the with statement when used with mulltiple
>>> objects only works with the last parameter.
>>>
>>>
>>> The statement
>>>
>
On Sun, Sep 14, 2014 at 02:30:01PM +0200, Marco van de Voort wrote:
In our previous episode, J?rgen Hestermann said:
> -
> d:=TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]; // local var d
> d^.DirLogged := true;
> d^.DirHatFocus
Am 15.09.2014 09:08 schrieb "Graeme Geldenhuys" <
mailingli...@geldenhuys.co.uk>:
>
> On 2014-09-14 13:30, Marco van de Voort wrote:
> > WITH doesn't, and you risk that if your class or one of its ancestor has
> > such property, and your error goes unnoticed.
>
> +1
>
> Not to mention that you can'
Bernd Oppolzer wrote:
PL/1 was designed in the mid 60s, and Wirth of course knew about PL/1,
because he was at IBM at the time, and of course he was aware of the
problems and pitfalls of PL/1.
I didn't know that Wirth had been directly associated with IBM. I did
know that while at Stanford h
Graeme Geldenhuys wrote:
As already mentioned, human refactoring of WITH statements can, and has,
caused lots of debugging issues afterwards.
If Dijkstra had written a letter to the CACM cautioning against the With
statement, I wonder whether Wirth would have headlined it "With
Statement Con
On 2014-09-14 13:30, Marco van de Voort wrote:
> WITH doesn't, and you risk that if your class or one of its ancestor has
> such property, and your error goes unnoticed.
+1
Not to mention that you can't use tooltip debugging when it comes to the
WITH statement - at least this was the case last ti
On 2014-09-14 15:41, Vojtěch Čihák wrote:
> because Editor is also public property of TStringGrid. Here would be
> solution to rename parameter to "AEditor".
Yes, that is a classic issue I have often come across.
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free
On 2014-09-14 11:49, Sven Barth wrote:
> Though to be honest Lazarus handles with-statements in context of debugging
> much more gracefully than Delphi...
We all know Lazarus is way better that Delphi - so that's always good to
know. :)
As already mentioned, human refactoring of WITH statements c
On Mon, September 15, 2014 07:55, Sven Barth wrote:
> On 14.09.2014 18:05, Philippe wrote:
>> someone wrote about a better performance using "with". is that true?
>> even with a simple pointer as in:
.
.
> This is the relevant code generated for TestWith:
>
> === asm begin ===
>
> # [28] with p^
On Monday 15 September 2014 07:55:20 Sven Barth wrote:
>
> As you can see the expression p^ is only evaluated once in the TestWith
> case while it's evaluated twice in the TestWithout one. So it's only
> minimally faster in this example (one less memory access), but if you
> use enough members of T
On 15.09.2014 03:06, Jim Leonard wrote:
On 9/13/2014 2:02 PM, Sven Barth wrote:
It has always worked in this manner. It's just for abbreviating typing,
not for combining properties. (and then the with-variant with multiple
elements is even more seldomly used than the single-element one...)
In
On 14.09.2014 18:05, Philippe wrote:
someone wrote about a better performance using "with". is that true?
even with a simple pointer as in:
with ptr^ do
begin
prop1 := ...
prop2 := ...
end;
which should be faster then
ptr^.prop1 := ...
ptr^.prop1 := ...
others wrote it is just usefull to
On 9/13/2014 2:02 PM, Sven Barth wrote:
It has always worked in this manner. It's just for abbreviating typing,
not for combining properties. (and then the with-variant with multiple
elements is even more seldomly used than the single-element one...)
In the Turbo Pascal days, WITH allowed for s
El 14/09/14 12:22, Jürgen Hestermann ha escrit:
>> -
>> d:=TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]; // local var d
>> d^.DirLogged := true;
>> d^.DirHatFocus := false;
>> d^.SubDirsExpanded := true;
>> [...] --
someone wrote about a better performance using "with". is that true?
even with a simple pointer as in:
with ptr^ do
begin
prop1 := ...
prop2 := ...
end;
which should be faster then
ptr^.prop1 := ...
ptr^.prop1 := ...
others wrote it is just usefull to save writing
time ...
Em
El 14/09/14 17:20, Marco van de Voort ha escrit:
> In our previous episode, Martin Schreiber said:
>>> basically stopped using it.
>>
>> Why does Free Pascal not invent a safe "with" similar as the "with" of
>> MSElang?
>
> The primary question is of course if there is a need for a new construct
main problem seems to be using property whose name is common within
2 objects of the same "with" (or code within several "with")
could it
be controlled by a compiler option?
in that case compiler may return a
hint or warning or even an error depending of the choosen configuration
...
does
In our previous episode, Martin Schreiber said:
> > basically stopped using it.
>
> Why does Free Pascal not invent a safe "with" similar as the "with" of
> MSElang?
The primary question is of course if there is a need for a new construct at
all. I don't know MSELang, but many new languages try
On Sunday 14 September 2014 16:34:06 Marco van de Voort wrote:
>
> In the past I had the same opinion about with (WITHs evilness is
> exaggerated) as many others, but once I bumped my head a few times while
> using OO frameworks that were either not of my design or very large, I
> basically stopped
The reason why I made these comparisons to PL/1:
PL/1 was designed in the mid 60s, and Wirth of course knew about PL/1,
because he was at IBM at the time, and of course he was aware of the
problems
and pitfalls of PL/1. By including the WITH statement into PASCAL, he
probably
wanted to give the
Hi,
once I came to troubles with "with":
procedure TForm1.StringGrid1SelectEditor(Sender: TObject; aCol, aRow: Integer;
var Editor: TWinControl);
begin
with StringGrid1 do
begin
...
Editor:= ...;
...
end;
end;
because Editor is also public property of TStringGrid
Am 14.09.2014 15:39, schrieb Ched:
Hello All,
My two cents. The with statement is crystal clear for me. If newbies
prefer to use different manners to code the things, that are free to
do it. Using some kind of intermediate variable ? That's make to code
difficult to understand, need do open
In our previous episode, Ched said:
> So, they with statement has at least one aficionados: me. Was the with
> statement present if the first
> versions designed by Wirth himself ?
Yes, but the problems are mostly because of the scoping complexity that OO
extensions like classes add. Specially b
Ched wrote:
Hello All,
My two cents. The with statement is crystal clear for me. If newbies
prefer to use different manners to code the things, that are free to do
it. Using some kind of intermediate variable ? That's make to code
difficult to understand, need do open begin/end blocks in som
Hello All,
My two cents. The with statement is crystal clear for me. If newbies prefer to use different manners to
code the things, that are free to do it. Using some kind of intermediate variable ? That's make to code
difficult to understand, need do open begin/end blocks in some situations.
-1. !!!
I like "with" ... even it may give trouble times to
times!!! ... but I work alone on my programs ...
as always ... nothing
perfect! always should consider the conditions!!
Em 14.09.2014
09:30, Michael Thompson escreveu:
>> We have spend weeks (if not
months) off hunting
> We have spend weeks (if not months) off hunting down this kind of bugs.
> And its this kind of bug what showed up frequently in teams of
> programmers and that made us decide to ban the with statement as much
> as possible. Sooner or later the with stament is going to bite you, I
> just hope you
In our previous episode, J?rgen Hestermann said:
> > -
> > d:=TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]; // local var d
> > d^.DirLogged := true;
> > d^.DirHatFocus := false;
> > d^.SubDirsExpanded := true;
> >
Jürgen Hestermann wrote:
>Do you also prepent all function and variable names
>with the unit name they come from?
>Do you realy always write
>
>LazUTF8.UTF8Delete
>instead of
>UTF8Delete
>?
>
>Nested WITH statements and the unit concept share the
>same problem but still the benefits outweigh the d
Jürgen Hestermann wrote:
>Realy? I love it. Consider these two varianst of code from one of my
>programs:
This is a simpler example than the one with with the 4 levels deep
(which can be quite a puzzle if there are multiple records containing
the same fieldname(s)). And yes you may love them but
Am 14.09.2014 09:36 schrieb "Graeme Geldenhuys" <
mailingli...@geldenhuys.co.uk>:
>
> On 2014-09-13 21:04, Mattias Gaertner wrote:
> >> What is the rationale for such a statement, ie using multliple
elements?
> > Less typing.
>
> ...and increases grey hair growth (due to lots more trouble debugging
Am 2014-09-14 12:08, schrieb Mattias Gaertner:
>> > All seasoned programmers know that and try to avoid the with statement.
> The quote is from Marius, not from me.
Correct. I deleted the wrong reference. ;-(
>> Realy? I love it. Consider these two varianst of code from one of my
programs:
>>
On Sun, 14 Sep 2014 11:58:22 +0200
Jürgen Hestermann wrote:
> Am 2014-09-13 22:31, schrieb Marius:
> > Mattias Gaertner wrote:
> > All seasoned programmers know that and try to avoid the with statement.
The quote is from Marius, not from me.
> Realy? I love it. Consider these two varianst of
Am 2014-09-13 22:31, schrieb Marius:
> Mattias Gaertner wrote:
> All seasoned programmers know that and try to avoid the with statement.
Realy? I love it. Consider these two varianst of code from one of my programs:
-
with TreeRoot.SubDirs
On 2014-09-13 21:31, Marius wrote:
> programmers know that and try to avoid the with statement.
+1
Regards,
- Graeme -
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
On 2014-09-13 21:04, Mattias Gaertner wrote:
>> What is the rationale for such a statement, ie using multliple elements?
> Less typing.
...and increases grey hair growth (due to lots more trouble debugging). :-)
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free P
El 13/09/14 20:13, vfclists . ha escrit:
> I thought all the 3 labels would have the caption set, but only Label3's
> caption is set. Is this a difference between Delphi's Object Pascal and
> FreePascal, or has Delphi's Object Pascal always worked in the same manner?
The "with" syntax comes from
Mattias Gaertner wrote:
>Less typing.
Just some generic comments in general.
Its also much harder to understand in the long run and it can even be
dangerous as stuff migh be refactored over time. All seasoned
programmers know that and try to avoid the with statement.
__
On Sat, 13 Sep 2014 20:29:32 +0100
"vfclists ." wrote:
>[...]
> What then is the nesting for if the command will only apply to the last
> item with the property?
The compiler searches the identifier in the last With, then in the
second last With, ..., then in the local variables, then in the
pa
On 13.09.2014 21:29, vfclists . wrote:
What then is the nesting for if the command will only apply to the last
item with the property? Is each nested element supposed to be a property
of the enclosing element?
What is the rationale for such a statement, ie using multliple elements?
Consider th
On 13 September 2014 20:02, Sven Barth wrote:
> On 13.09.2014 20:13, vfclists . wrote:
>
>> According to the docs the with statement when used with mulltiple
>> objects only works with the last parameter.
>>
>>
>> The statement
>>
>> With A,B,C,D do Statement;
>>
>> is equivalent to
>>
>> With A
On 13.09.2014 20:13, vfclists . wrote:
According to the docs the with statement when used with mulltiple
objects only works with the last parameter.
The statement
With A,B,C,D do Statement;
is equivalent to
With A do
With B do
With C do
With D do Statement;
--
I thought that if al
According to the docs the with statement when used with mulltiple objects
only works with the last parameter.
The statement
With A,B,C,D do Statement;
is equivalent to
With A do
With B do
With C do
With D do Statement;
--
I thought that if all the objects have the property the statement
60 matches
Mail list logo