Re: [fpc-pascal] Bls: Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Sven Barth
Am 25.02.2016 02:00 schrieb "Mr Bee" :
> Maybe FPC devs should give us the "rule" or policy about what kind of
change that is acceptable and not acceptable. So when we think of something
new we could look at the rule and if it's doesn't comply then we don't need
to bother to propose.

There is not one rule. It always depends on the context. E.g. here the code
needs to stay compatible with Delphi does assign a FPC only feature won't
help. On the other hand the {$J-} change would.not be backwards compatible
as older Delphi versions had it enabled as well. In essence it's always
decided on a case by case base what is more important.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] MSEide+MSEgui 4.2

2016-02-24 Thread Martin Schreiber
Hi,

MSEide+MSEgui 4.2 has been released:
https://sourceforge.net/projects/mseide-msegui/files/mseide-msegui/4.2/

There are also new versions of MSEgit, MSEspice and MSErun:
https://sourceforge.net/projects/mseuniverse/files/

New target: Windows 64 bit.

Martin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Bls: Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Mr Bee
Pada Rabu, 24 Februari 2016 18:40, Marco van de Voort  menulis:



 > In our previous episode, Mark Morgan Lloyd said:
> > > (remember recent discussion about IfThen pseudo-function).
> > 
> > More relevant to your situation, I remember discussion about adding an 
> > identifier to WITH to use as an explicit shortcut, i.e. something like
> > 
> > with foo= bar do
> >    foo.someField := ...
> 
> Not relevant since the With code in this case must remain delphi compatible.> 

Sometimes I just don't understand the policy of FPC devs about Delphi 
compatibility. In some cases, they said FPC isn't a slave of Delphi, FPC should 
have better goal than Delphi, there's the Delphi way and there's the FPC way, 
breaking old codes is consequence of a change, bla bla bla…. 
But in some other times, like now in this case, the 'with' case, they said that 
it must be Delphi compatible, don't break old codes, keep the compatibility, 
bla bla bla…. Like when they responded to my proposal to set {$J-} as default 
because that's how a const is suppose to be. And it's the default now on Delphi 
as well.
Maybe FPC devs should give us the "rule" or policy about what kind of change 
that is acceptable and not acceptable. So when we think of something new we 
could look at the rule and if it's doesn't comply then we don't need to bother 
to propose.
Regards,
–Mr Bee
  ___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Possible bug in Numeric test

2016-02-24 Thread Bart
On 2/24/16, steveg  wrote:
> Not sure if this is considered a bug or not :)


Fully compatible with Delphi 7.


{$apptype console}
{$ifdef fpc}
{$mode objfpc}
{$h+}
{$codepage utf8}
{$endif}


{$R+}

uses
  classes,sysutils;

function IsNum( const sSrc :string ) :boolean;
var
  Code :integer;
  Num :real;
begin
  Val(sSrc, Num, Code);
  Result := ( Code = 0 );
end;


var
  R: Real;
  Code: Integer;
begin
  Val('E1',R,Code);
  writeln('E1 : Code = ',Code,#32, IsNum('E1'));
  Val('E',R,Code);
  writeln('E  : Code = ',Code,#32, IsNum('E'));
  Val('1E',R,Code);
  writeln('1E : Code = ',Code,#32, IsNum('1E'));
  Val('1E1',R,Code);
  writeln('1E1: Code = ',Code,#32, IsNum('1E1'));
  Val('E1/E2/etc',r,Code);
  writeln('etc: Code = ',Code,#32, IsNum('E1/E2/etc'));
end.

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>dcc32 test.pas
Borland Delphi Version 15.0
Copyright (c) 1983,2002 Borland Software Corporation
test.pas(19) Hint: Value assigned to 'Num' never used
test.pas(36) Hint: Value assigned to 'R' never used
test.pas(34) Hint: Value assigned to 'R' never used
test.pas(32) Hint: Value assigned to 'R' never used
test.pas(30) Hint: Value assigned to 'R' never used
test.pas(28) Hint: Value assigned to 'R' never used
test.pas(39)
40 lines, 0.20 seconds, 71676 bytes code, 4097 bytes data.

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
E1 : Code = 0 TRUE
E  : Code = 2 FALSE
1E : Code = 3 FALSE
1E1: Code = 0 TRUE
etc: Code = 3 FALSE

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>fpc test.pas
Free Pascal Compiler version 3.0.0 [2015/11/16] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
test.pas(17,3) Note: Local variable "Num" is assigned but never used
test.pas(25,3) Note: Local variable "R" is assigned but never used
Linking test.exe
38 lines compiled, 2.6 sec, 133856 bytes code, 5828 bytes data
2 note(s) issued

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
E1 : Code = 0 TRUE
E  : Code = 2 FALSE
1E : Code = 3 FALSE
1E1: Code = 0 TRUE
etc: Code = 3 FALSE

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Possible bug in Numeric test

2016-02-24 Thread Vojtěch Čihák

Oh, I didn't catch it. So there must be some checking for E in the string - at 
least on the first place - because strings 'E' and '1E' returns FALSE. 
__

Od: Nitorami 
Komu: 
Datum: 24.02.2016 22:22
Předmět: Re: [fpc-pascal] Possible bug in Numeric test


Steve probably means "when passed 'E1' or 'E2' etc."
Indeed IsNum ('E1') interprets it as zero and delivers TRUE.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Possible-bug-in-Numeric-test-tp5724297p5724319.html
 

Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Possible bug in Numeric test

2016-02-24 Thread Nitorami
Steve probably means "when passed 'E1' or 'E2' etc."
Indeed IsNum ('E1') interprets it as zero and delivers TRUE.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Possible-bug-in-Numeric-test-tp5724297p5724319.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Possible bug in Numeric test

2016-02-24 Thread Vojtěch Čihák

I tried your function in FPC 3.0.0 in mode ObjFPC and it returns False for 
string 'E1/E2/etc'.
 
V.
__

Od: steveg 
Komu: "FPC-Pascal users discussions" 
Datum: 24.02.2016 00:57
Předmět: [fpc-pascal] Possible bug in Numeric test


Not sure if this is considered a bug or not :)

I have found this function returns TRUE if passed 'E1/E2/etc'
I am guessing it is seeing the 'E' as exponent


function IsNum( const sSrc :string ) :boolean;
var
  Code :integer;
  Num :real = 0;
begin
  Num := Num;
  Val(sSrc, Num, Code);
  Exit( Code = 0 );
end;

Thanks - SteveG
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Vojtěch Čihák

Assigning static class methods to procedure variables in ObjFPC would be very 
nice feature.
 
V.
__

Od: Sven Barth 
Komu: "FPC-Pascal users discussions" 
Datum: 24.02.2016 17:22
Předmět: Re: [fpc-pascal] Compiler Mode?

* Unlogical approach for static; modifier (I can't use static methods as 
callback in objfpc... the main reason of introducing static in Delphi is 
callback for api...)

AFAIK that's a general problem we currently have with static and not just 
restricted to mode ObjFPC. At least in my opinion the assignment of such 
methods to normal procedure variables should be possible no matter which mode 
is selected.
 
Regards,
Sven


--

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Sven Barth
Am 24.02.2016 16:44 schrieb "Mark Morgan Lloyd" <
markmll.fpc-pas...@telemetry.co.uk>:
>
> Bo Berglund wrote:
>>
>> On Tue, 23 Feb 2016 23:58:37 +0100, Sven Barth
>>  wrote:
>>>
>>> What would really help here would be the warning that Jonas mentioned...
>>> For the above you could just use a local variable and be done with it.
No
>>> need to try to "fix" the with-statement.
>>
>>
>> I really fully agree!
>
>
> Perhaps a hint when a single WITH is used and a warning if they're
nested. After all, it /is/ a standard part of the language.

A warning when another identifier is shadowed might be more useful as Jonas
said. Cause then one could find all problematic identifiers and not just
all withs...

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Sven Barth
Am 24.02.2016 12:30 schrieb "Bo Berglund" :
>
> On Tue, 23 Feb 2016 23:58:37 +0100, Sven Barth
>  wrote:
> >
> >What would really help here would be the warning that Jonas mentioned...
> >For the above you could just use a local variable and be done with it. No
> >need to try to "fix" the with-statement.
>
> I really fully agree!
> When working a few years back I had to trace through a piece of code
> where the original author had done something like:
>
> with My.Stuff.something do
>   with My.Other.Stuff.somethingelse do
> with myyetanother do
> begin
>   someproperty := xxx;
>   
>   
> end;
> It was totally impossible to make sense of anything while debugging!

Just as a sidenote: Lazarus handles withs correctly while debugging ;)

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Sven Barth
Am 24.02.2016 13:10 schrieb "Maciej Izak" :
>
> 2016-02-24 12:48 GMT+01:00 Anthony Walter :
>>
>> On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong
and should not be used other than for people or companies trying to convert
Delphi code to Free Pascal.
>>
>> What's the official position on this point?
>
>
> Delphi is IMO the best available mode. ObjPas is unusable for me for many
reasons, few of them:
>
> * Different parsing of comments

Which is better in ObjFPC as it allows nesting of comments.

> * Unlogical approach for static; modifier (I can't use static methods as
callback in objfpc... the main reason of introducing static in Delphi is
callback for api...)

AFAIK that's a general problem we currently have with static and not just
restricted to mode ObjFPC. At least in my opinion the assignment of such
methods to normal procedure variables should be possible no matter which
mode is selected.

> * I cant use the same name for class var and for parameter in method
http://bugs.freepascal.org/view.php?id=24963

That's by design.

> * generic and specialize keyword hell in extensively used generics...

On the other hand complex inline specialization expressions work in mode
ObjFPC, while they don't in mode Delphi...

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Mark Morgan Lloyd

Bo Berglund wrote:

On Tue, 23 Feb 2016 23:58:37 +0100, Sven Barth
 wrote:

What would really help here would be the warning that Jonas mentioned...
For the above you could just use a local variable and be done with it. No
need to try to "fix" the with-statement.


I really fully agree!


Perhaps a hint when a single WITH is used and a warning if they're 
nested. After all, it /is/ a standard part of the language.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said:
> 
> As said, ours is an opinion.

... and not unanimous :-)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Serguei TARASSOV
etrusco wrote
> I loved 'with' while I was learning Delphi/Pascal and hated after the
> first few months since using it professionaly. I truly believe it
> warrants/deserves some advice in the documentation, for the beginners.
> With the code completion in Lazarus there's even less reason to use it
> - besides any possibly missing compiler optimization...

Indeed, there are no big differences between "uses" and "with" in Object
Pascal, "using namespace" in C++ or "using" in C#.
For example, my short article "Crack C# namespaces in 30 seconds"
http://arbinada.com/main/en/node/1416




-
--
Regards,
Serguei
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Bug-in-FPC-3-0-0-was-Bug-in-FPC-3-0-0-tp5724274p5724311.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Flávio Etrusco
On Wed, Feb 24, 2016 at 9:00 AM, Michael Van Canneyt
 wrote:
>
>
> On Wed, 24 Feb 2016, Flávio Etrusco wrote:
>
>> On Wed, Feb 24, 2016 at 8:39 AM, Marco van de Voort 
>> wrote:
>>>
>>> In our previous episode, Mark Morgan Lloyd said:

 > (remember recent discussion about IfThen pseudo-function).

 More relevant to your situation, I remember discussion about adding an
 identifier to WITH to use as an explicit shortcut, i.e. something like

 with foo= bar do
foo.someField := ...
>>>
>>>
>>> Not relevant since the With code in this case must remain delphi
>>> compatible.
>>
>>
>> I, for one, would vote in favor making the documentation discourage
>> the use of 'with' and adding a warning in compiler...
>
>
> I don't see why.
>
> I use "with" extensively. I see nothing wrong with this useful construct.
>
> The problem of the 'new identifier inserted in scope' exists, but is rare
> enough for me to tip the balance in favour of using "with". It has maybe
> happened once or twice in 25 years that I got bitten by it.
>
> I find that perfectly acceptable.
>
> For people that worry about this, the solution of Jonas should be ample to
> detect/avoid mistakes.
>
> Michael.

I loved 'with' while I was learning Delphi/Pascal and hated after the
first few months since using it professionaly. I truly believe it
warrants/deserves some advice in the documentation, for the beginners.
With the code completion in Lazarus there's even less reason to use it
- besides any possibly missing compiler optimization...

Best regards,
Flávio
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Serguei TARASSOV
Good, I see yours points.
Not so impressed, don't really share. The community spirit does not inspire
confidence.

I stay with FPC/Lazarus for some fun projects like FBProfiler
(https://sourceforge.net/projects/fbprofiler/) but for "real world programs"
the migration is canceled until better times.



-
--
Regards,
Serguei
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Bug-in-FPC-3-0-0-was-Bug-in-FPC-3-0-0-tp5724274p5724309.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Maciej Izak
2016-02-24 13:15 GMT+01:00 Michael Van Canneyt :

> As said, ours is an opinion. Your mileage may vary.


Phew ;) everyone can be happy!
-- 
Best regards,
Maciej Izak
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Michael Van Canneyt



On Wed, 24 Feb 2016, Graeme Geldenhuys wrote:


On 2016-02-24 11:57, Michael Van Canneyt wrote:

We think {$Mode objpas} is the better mode, but this is just our private
opinion.



I assume you meant:  {$mode objfpc}   ?


Yes, of course, typo...

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Michael Van Canneyt



On Wed, 24 Feb 2016, Maciej Izak wrote:


2016-02-24 12:48 GMT+01:00 Anthony Walter :


On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong
and should not be used other than for people or companies trying to convert
Delphi code to Free Pascal.

What's the official position on this point?



Delphi is IMO the best available mode. ObjPas is unusable for me for many
reasons, few of them:

* Different parsing of comments
* Unlogical approach for static; modifier (I can't use static methods as
callback in objfpc... the main reason of introducing static in Delphi is
callback for api...)
* I cant use the same name for class var and for parameter in method
http://bugs.freepascal.org/view.php?id=24963
* generic and specialize keyword hell in extensively used generics...


As said, ours is an opinion. Your mileage may vary.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Graeme Geldenhuys
On 2016-02-24 11:57, Michael Van Canneyt wrote:
> We think {$Mode objpas} is the better mode, but this is just our private
> opinion.


I assume you meant:  {$mode objfpc}   ?


Regards,
  - Graeme -

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Maciej Izak
2016-02-24 12:48 GMT+01:00 Anthony Walter :

> On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong
> and should not be used other than for people or companies trying to convert
> Delphi code to Free Pascal.
>
> What's the official position on this point?
>

Delphi is IMO the best available mode. ObjPas is unusable for me for many
reasons, few of them:

* Different parsing of comments
* Unlogical approach for static; modifier (I can't use static methods as
callback in objfpc... the main reason of introducing static in Delphi is
callback for api...)
* I cant use the same name for class var and for parameter in method
http://bugs.freepascal.org/view.php?id=24963
* generic and specialize keyword hell in extensively used generics...

-- 
Best regards,
Maciej Izak
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Michael Van Canneyt



On Wed, 24 Feb 2016, Flávio Etrusco wrote:


On Wed, Feb 24, 2016 at 8:39 AM, Marco van de Voort  wrote:

In our previous episode, Mark Morgan Lloyd said:

> (remember recent discussion about IfThen pseudo-function).

More relevant to your situation, I remember discussion about adding an
identifier to WITH to use as an explicit shortcut, i.e. something like

with foo= bar do
   foo.someField := ...


Not relevant since the With code in this case must remain delphi compatible.


I, for one, would vote in favor making the documentation discourage
the use of 'with' and adding a warning in compiler...


I don't see why.

I use "with" extensively. I see nothing wrong with this useful construct.

The problem of the 'new identifier inserted in scope' exists, but is rare
enough for me to tip the balance in favour of using "with". It has maybe
happened once or twice in 25 years that I got bitten by it.

I find that perfectly acceptable.

For people that worry about this, the solution of Jonas should be ample to
detect/avoid mistakes.

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Michael Van Canneyt



On Wed, 24 Feb 2016, Anthony Walter wrote:


On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong and
should not be used other than for people or companies trying to convert
Delphi code to Free Pascal.

What's the official position on this point?


People are free to use whatever mode suits them best.

But {$Mode delphi} is intended to make the compiler behave as much as
possible as the Delphi compiler, and thus should be most suitable for
companies trying to convert Delphi code to Free Pascal.

We think {$Mode objpas} is the better mode, but this is just our private
opinion.

Note that the mode switch says only something about the available Object 
Pascal language constructs when compiling code.


It also doesn't say anything about behaviour of other units in your current
code. In particular: It doesn't say anything about the available identifiers 
in units that are available both in Delphi and FPC. (sysutils, classes, db).


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Flávio Etrusco
On Wed, Feb 24, 2016 at 8:39 AM, Marco van de Voort  wrote:
> In our previous episode, Mark Morgan Lloyd said:
>> > (remember recent discussion about IfThen pseudo-function).
>>
>> More relevant to your situation, I remember discussion about adding an
>> identifier to WITH to use as an explicit shortcut, i.e. something like
>>
>> with foo= bar do
>>foo.someField := ...
>
> Not relevant since the With code in this case must remain delphi compatible.

I, for one, would vote in favor making the documentation discourage
the use of 'with' and adding a warning in compiler...

Best regards,
Flávio
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Compiler Mode?

2016-02-24 Thread Anthony Walter
On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong and
should not be used other than for people or companies trying to convert
Delphi code to Free Pascal.

What's the official position on this point?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said:
> > (remember recent discussion about IfThen pseudo-function).
> 
> More relevant to your situation, I remember discussion about adding an 
> identifier to WITH to use as an explicit shortcut, i.e. something like
> 
> with foo= bar do
>foo.someField := ...

Not relevant since the With code in this case must remain delphi compatible.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Bo Berglund
On Tue, 23 Feb 2016 23:58:37 +0100, Sven Barth
 wrote:
>
>What would really help here would be the warning that Jonas mentioned...
>For the above you could just use a local variable and be done with it. No
>need to try to "fix" the with-statement.

I really fully agree!
When working a few years back I had to trace through a piece of code
where the original author had done something like:

with My.Stuff.something do
  with My.Other.Stuff.somethingelse do
with myyetanother do
begin
  someproperty := xxx;
  
  
end;
It was totally impossible to make sense of anything while debugging!

WITH should be abolished in my view!

I had to make local variables to shorten down the length of the
identifiers and then put the correct variable in front like:
  MS.someproperty := xxx;

Only then was it possible to inspect the values while debugging.

Further: I see every other day in the Embarcadero forum comments by
Remy Lebeau where he strongly advices against using WITH. Only goes to
show that it plagues Delphi as well.

Join the crusade against WITH!!!


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal