[fpc-pascal] Re: Duplicate Identifier

2012-03-01 Thread leledumbo
> However the compiler specifically names other units as the culprit, so who
knows.

Yep, and according to the error message, what if you open the corresponding
unit at the position told by the compiler?

Hint: Your form must be a descendant of TForm which perhaps has... guess it
;)

--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Re-Duplicate-Identifier-tp5526700p5529875.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/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Weird compilation warnings

2012-03-01 Thread Guillermo Martínez Jiménez
Oh, I see.  It has sense.  The "extra implicit parameter" part
confused me because I didn't use OOP in that project.

Thank you :)

2012/3/1  :
> From: Sven Barth 
> Subject: Re: [fpc-pascal] Weird compilation warnings
>
> Am 29.02.2012 22:53, schrieb Guillermo Martínez Jiménez:
>> Hello,
>>
>> FPC is returning the "Warning: cdecl’ared functions have no high
>> parameter" but I have no idea why.  The documentation just says
>> "Functions declared with the cdecl modifier do not pass an extra
>> implicit parameter." but the affected functions don't have any "extra
>> implicit parameter".
>>
>> I'm using FPC 2.4.2 (the one that came with Lazarus).
>>
>> Here you have some sample code:
>> ___
>>
>> UNIT a...;
>> IMPLEMENTATION
>>
>>    {$MODE FPC}
>>    {$PACKRECORDS C}
>>    {$LONGSTRINGS ON}
>>
>> { Next declaration compiles Ok. }
>>    PROCEDURE al_draw_ustr (CONST font: ALLEGRO_FONTptr; color:
>> ALLEGRO_COLOR; x, y: SINGLE; flags: LONGINT; CONST ustr:
>> ALLEGRO_USTRptr); CDECL;
>>
>> { Next one raises the "WARNING" }
>>    FUNCTION al_grab_font_from_bitmap (bmp: ALLEGRO_BITMAPptr; n:
>> LONGINT; ranges: ARRAY OF LONGINT): ALLEGRO_FONTptr; CDECL;
>> ...
>
> You are passing an open array here. open arrays are realized internally
> by passing a pointer to the start of the array and an (implicit) high
> parameter which lets the compiler deduce the length of the array. This
> is not supported with cdecl or cppdecl. If you want a cdecl function to
> receive an array you should write something like this:
>
>     FUNCTION al_grab_font_from_bitmap (bmp: ALLEGRO_BITMAPptr; n:
>  LONGINT; ranges: PLONGINT; len: LONGINT): ALLEGRO_FONTptr; CDECL;
>
> Do you want to provide this functions from inside a DLL? If so you
> should use my above variant, because other languages don't understand
> Pascal's open arrays (because of the implicit high parameter). If you
> only use the function inside your own Pascal code I suggest you to not
> use cdecl functions if it's not really necessary.
>
> Regards,
> Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Duplicate Identifier

2012-03-01 Thread Sven Barth

On 01.03.2012 21:42, Marcos Douglas wrote:

On Thu, Mar 1, 2012 at 5:14 PM, Sven Barth  wrote:

On 01.03.2012 16:34, Marcos Douglas wrote:


On Thu, Mar 1, 2012 at 4:29 AM, leledumbo
  wrote:


That's different case IMHO (In My Humble Observation), I guess it's
something
like this:

{$mode objfpc}
type
  TTestClass = class
FTile: Integer;
property Tile: Integer read FTile write FTile;
procedure Test;
  end;

procedure TTestClass.Test;
var
  Tile: Integer;
begin
end;

begin
end.

In this case, the local variable has the same name as one of the class
properties. This does trigger the "duplicate identifier" error because
both
have the same scope.



Well, for me the local Tile variable should have "preference" because
the scope is local, not "global for class".
Would be equal the use of arguments, IMHO, where we can use an
identifier that already exists in the class.



In mode Delphi this is true, but in non-Delphi modes it was decided that the
above code is not allowed at all to avoid any disambiguities that might
arise.

Regards,
Sven


So, I have to invent a prefix or suffix in all local variables to
avoid problems if I add a property with same name in the future,
right?
ex:
   lTile: Integer
   Tile1: Integer
   vTile: Integer

...well, I already do that, but I don't think this is correct.


The compiler will generate an error if you do add a property with the 
same name, so you can change the name of the variable in the method on 
demand.


Also note that this feature is not a recent one. This is part of FPC 
AFAIK at least since 2.2.0 (which is the first version I used). So if 
you didn't encounter the problem yet, maybe you never will ;)


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


Re: [fpc-pascal] Re: Duplicate Identifier

2012-03-01 Thread Marcos Douglas
On Thu, Mar 1, 2012 at 5:14 PM, Sven Barth  wrote:
> On 01.03.2012 16:34, Marcos Douglas wrote:
>>
>> On Thu, Mar 1, 2012 at 4:29 AM, leledumbo
>>  wrote:
>>>
>>> That's different case IMHO (In My Humble Observation), I guess it's
>>> something
>>> like this:
>>>
>>> {$mode objfpc}
>>> type
>>>  TTestClass = class
>>>    FTile: Integer;
>>>    property Tile: Integer read FTile write FTile;
>>>    procedure Test;
>>>  end;
>>>
>>> procedure TTestClass.Test;
>>> var
>>>  Tile: Integer;
>>> begin
>>> end;
>>>
>>> begin
>>> end.
>>>
>>> In this case, the local variable has the same name as one of the class
>>> properties. This does trigger the "duplicate identifier" error because
>>> both
>>> have the same scope.
>>
>>
>> Well, for me the local Tile variable should have "preference" because
>> the scope is local, not "global for class".
>> Would be equal the use of arguments, IMHO, where we can use an
>> identifier that already exists in the class.
>
>
> In mode Delphi this is true, but in non-Delphi modes it was decided that the
> above code is not allowed at all to avoid any disambiguities that might
> arise.
>
> Regards,
> Sven

So, I have to invent a prefix or suffix in all local variables to
avoid problems if I add a property with same name in the future,
right?
ex:
  lTile: Integer
  Tile1: Integer
  vTile: Integer

...well, I already do that, but I don't think this is correct.

Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Duplicate Identifier

2012-03-01 Thread Sven Barth

On 01.03.2012 16:34, Marcos Douglas wrote:

On Thu, Mar 1, 2012 at 4:29 AM, leledumbo  wrote:

That's different case IMHO (In My Humble Observation), I guess it's something
like this:

{$mode objfpc}
type
  TTestClass = class
FTile: Integer;
property Tile: Integer read FTile write FTile;
procedure Test;
  end;

procedure TTestClass.Test;
var
  Tile: Integer;
begin
end;

begin
end.

In this case, the local variable has the same name as one of the class
properties. This does trigger the "duplicate identifier" error because both
have the same scope.


Well, for me the local Tile variable should have "preference" because
the scope is local, not "global for class".
Would be equal the use of arguments, IMHO, where we can use an
identifier that already exists in the class.


In mode Delphi this is true, but in non-Delphi modes it was decided that 
the above code is not allowed at all to avoid any disambiguities that 
might arise.


Regards,
Sven

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


Re: [fpc-pascal] Pascal type-parametric definitions

2012-03-01 Thread Sven Barth
Am 01.03.2012 12:29 schrieb "Lukasz Stafiniak" :
>
> Why are type-parametric definitions called generics in Pascal? It
> seems to me their semantics is like templates in C++, not like
> generics in Java/C# (or ML languages).

They are named generics, because they are "generic" as in "can be used for
everything". We do not need to follow the naming of other languages. Also
there is the possibility that FPC's generics might be optimized a bit for
inheritable types (class, object, interface) once they are feature
complete. Then they would behave more like Java generics for such types.

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

Re: [fpc-pascal] Re: Duplicate Identifier

2012-03-01 Thread Marcos Douglas
On Thu, Mar 1, 2012 at 4:29 AM, leledumbo  wrote:
> That's different case IMHO (In My Humble Observation), I guess it's something
> like this:
>
> {$mode objfpc}
> type
>  TTestClass = class
>    FTile: Integer;
>    property Tile: Integer read FTile write FTile;
>    procedure Test;
>  end;
>
> procedure TTestClass.Test;
> var
>  Tile: Integer;
> begin
> end;
>
> begin
> end.
>
> In this case, the local variable has the same name as one of the class
> properties. This does trigger the "duplicate identifier" error because both
> have the same scope.

Well, for me the local Tile variable should have "preference" because
the scope is local, not "global for class".
Would be equal the use of arguments, IMHO, where we can use an
identifier that already exists in the class.

Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Functional Pascal

2012-03-01 Thread Lukasz Stafiniak
On Thu, Mar 1, 2012 at 12:21 PM, Lukasz Stafiniak  wrote:
>
> Wow, I didn't know about that! Still, it is not clear to me it is a
> good thing to capture "var" variables in the closure. It goes against
> the semantics of normal nested functions. It's a "dirty but flexible"
> solution -- it makes it easy to define several closures out of a
> single definition (kind of like using partial application), e.g. when
> the anonymous function is inside a loop. Java doesn't have it
> (closures can only refer to "final" variables, "final"="val"="let").

I'm sorry, I got confused -- the closure in Pascal does not capture
the value of the variable (i.e. does not form a copy of the variable),
rather, the variable becomes heap-allocated (implicitly a field of
some class), and anonymous functions together with the function that
contains them share the variable. Making a copy would be an
interesting design choice... (although violating the semantics of
nested procedures.)

http://www.reddit.com/r/programming/comments/6tp3i/pascal_gets_closures_before_java_why_hasnt_the/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Frank Church
I think a web based page which tests the submitted file would be
better. That way everyone will be using the same latest and greatest
versioin. The chance of all committers running the same version of the
tools is virtually between nil and nothing.

PS. Is Basic HTML mode in GMail that fast?

On 01/03/2012, Reinier Olislagers  wrote:
> On 1-3-2012 10:29, Graeme Geldenhuys wrote:
>> On 1 March 2012 10:49, Reinier Olislagers  wrote:
>>>
>>> I understand why you changed it, but didn't get any error messages
>>> either - just redownloaded the original patch upload to make sure:
>>
>> Strange. I did the same test, and got lots of errors. And I get the
>> same errors if I generate CHM or HTML output too.
>>
>> --
>> /opt/fpc-2.7.1/x86_64-linux/bin/fpdoc --package=fcl
>> --input=/opt/fpc-2.7.1/src/packages/fcl-db/src/sqldb/interbase/ibconnection.pp
>> --descr=ibconnection.xml --output=ibconnection.ipf --format=ipf
>> FPDoc - Free Pascal Documentation Tool
>> Version 2.7.1 [2012/02/27]
>> (c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, s...@freepascal.org
>>
>> [#fcl.IBConnection.TIBConnection] Invalid paragraph content
>> [#fcl.IBConnection.TIBConnection] Invalid paragraph content
>> [#fcl.IBConnection.TIBConnection.Dialect] Invalid description (illegal
>> XML element: "#text")
>> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
>> XML element: "var")
>> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
>> XML element: "#text")
>> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
>> XML element: "link")
>> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
>> XML element: "#text")
>> Done.
>> --
>>
>>
>> * The first two are because you embedded an unordered list inside a
>> paragraph tag. Not allowed.
>> * .Dialact: Caused because you didn't have a  tag for the first
>> sentence inside the description., but
>>you did have an encloded paragraph tag for the second sectence.
>> ...
>
> Thanks, perhaps the fpdoc converter got improved a lot after fixes 2.6???
>
> Reinier
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Functional Pascal

2012-03-01 Thread Marco van de Voort
In our previous episode, Lukasz Stafiniak said:
> >> (2) Closures. That is, making local functions that only use "const"
> >> arguments and "val / let" variables safe to return from the outer
> >> function. This can be done by allocating the "val / let" data on the
> >> heap, or perhaps easier by copying them into an implicitly built
> >> object and interpreting the returned local function as pointer to
> >> method of this object. The closure-object would be memory-managed as
> >> other objects.
> > Closures are already supported by Delphi 2009 and are currently being worked
> > on by someone in FPC.
> 
> Wow, I didn't know about that! Still, it is not clear to me it is a
> good thing to capture "var" variables in the closure. It goes against
> the semantics of normal nested functions. It's a "dirty but flexible"
> solution -- it makes it easy to define several closures out of a
> single definition (kind of like using partial application), e.g. when
> the anonymous function is inside a loop. Java doesn't have it
> (closures can only refer to "final" variables, "final"="val"="let").

Anonymous functions (the actual name of that feature), while closurelike,
but not really meant as a basis for functional programming I think.

They are mainly used in the framework to quickly/easily schedule some work
in a different thread.

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


[fpc-pascal] Pascal type-parametric definitions

2012-03-01 Thread Lukasz Stafiniak
Why are type-parametric definitions called generics in Pascal? It
seems to me their semantics is like templates in C++, not like
generics in Java/C# (or ML languages).

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


[fpc-pascal] Functional Pascal

2012-03-01 Thread Lukasz Stafiniak
On Wed, Feb 29, 2012 at 11:31 AM, Sven Barth
 wrote:
> Am 28.02.2012 20:31, schrieb Lukasz Stafiniak:
>>
>> (1) A declaration part, that parallels "var", with keyword "val" or
>> "let" (since "val" is taken up by a procedure). It introduces named
>> values, i.e. non-assignable variables. The part after "=" can be any
>> expression. Therefore, this feature spoils the "declaration --
>> implementation divide" that is dear to Pascal.
>
>
> I personally don't see a use for this... but feel free to provide a useful
> example ;)

The main point is to perform some computation whose result is
subsequently captured when the nested function is defined (becomes
part of the closure).

>> (2) Closures. That is, making local functions that only use "const"
>> arguments and "val / let" variables safe to return from the outer
>> function. This can be done by allocating the "val / let" data on the
>> heap, or perhaps easier by copying them into an implicitly built
>> object and interpreting the returned local function as pointer to
>> method of this object. The closure-object would be memory-managed as
>> other objects.
>
>
> Closures are already supported by Delphi 2009 and are currently being worked
> on by someone in FPC.

Wow, I didn't know about that! Still, it is not clear to me it is a
good thing to capture "var" variables in the closure. It goes against
the semantics of normal nested functions. It's a "dirty but flexible"
solution -- it makes it easy to define several closures out of a
single definition (kind of like using partial application), e.g. when
the anonymous function is inside a loop. Java doesn't have it
(closures can only refer to "final" variables, "final"="val"="let").

Best,
Łukasz
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Reinier Olislagers
On 1-3-2012 10:29, Graeme Geldenhuys wrote:
> On 1 March 2012 10:49, Reinier Olislagers  wrote:
>>
>> I understand why you changed it, but didn't get any error messages
>> either - just redownloaded the original patch upload to make sure:
> 
> Strange. I did the same test, and got lots of errors. And I get the
> same errors if I generate CHM or HTML output too.
> 
> --
> /opt/fpc-2.7.1/x86_64-linux/bin/fpdoc --package=fcl
> --input=/opt/fpc-2.7.1/src/packages/fcl-db/src/sqldb/interbase/ibconnection.pp
> --descr=ibconnection.xml --output=ibconnection.ipf --format=ipf
> FPDoc - Free Pascal Documentation Tool
> Version 2.7.1 [2012/02/27]
> (c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, s...@freepascal.org
> 
> [#fcl.IBConnection.TIBConnection] Invalid paragraph content
> [#fcl.IBConnection.TIBConnection] Invalid paragraph content
> [#fcl.IBConnection.TIBConnection.Dialect] Invalid description (illegal
> XML element: "#text")
> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
> XML element: "var")
> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
> XML element: "#text")
> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
> XML element: "link")
> [#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
> XML element: "#text")
> Done.
> --
> 
> 
> * The first two are because you embedded an unordered list inside a
> paragraph tag. Not allowed.
> * .Dialact: Caused because you didn't have a  tag for the first
> sentence inside the description., but
>you did have an encloded paragraph tag for the second sectence.
> ...

Thanks, perhaps the fpdoc converter got improved a lot after fixes 2.6???

Reinier

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


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Graeme Geldenhuys
On 1 March 2012 10:55,   wrote:
>
> But I don't use chm, but latex. I suppose the xml->html converter is more
> forgiving about mistakes in your XML; maybe it takes some shortcuts. I would
> have to investigate.


Nope, I get the exact same errors even if I generate HTML or CHM or
IPF output. In fact, I get even more errors (rather warnings) for HTML
and CHM output.


Maybe he is using an older fpdoc, which wasn't so strict. I'm using
the latest from 2.7.1

-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Graeme Geldenhuys
On 1 March 2012 10:49, Reinier Olislagers  wrote:
>
> I understand why you changed it, but didn't get any error messages
> either - just redownloaded the original patch upload to make sure:

Strange. I did the same test, and got lots of errors. And I get the
same errors if I generate CHM or HTML output too.

--
/opt/fpc-2.7.1/x86_64-linux/bin/fpdoc --package=fcl
--input=/opt/fpc-2.7.1/src/packages/fcl-db/src/sqldb/interbase/ibconnection.pp
--descr=ibconnection.xml --output=ibconnection.ipf --format=ipf
FPDoc - Free Pascal Documentation Tool
Version 2.7.1 [2012/02/27]
(c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, s...@freepascal.org

[#fcl.IBConnection.TIBConnection] Invalid paragraph content
[#fcl.IBConnection.TIBConnection] Invalid paragraph content
[#fcl.IBConnection.TIBConnection.Dialect] Invalid description (illegal
XML element: "#text")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
XML element: "var")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
XML element: "#text")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
XML element: "link")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal
XML element: "#text")
Done.
--


* The first two are because you embedded an unordered list inside a
paragraph tag. Not allowed.
* .Dialact: Caused because you didn't have a  tag for the first
sentence inside the description., but
   you did have an encloded paragraph tag for the second sectence.
...


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: OT: Amazing new development tools

2012-03-01 Thread Mark Morgan Lloyd

Martin wrote:

On 27/02/2012 12:32, Lukasz Sokol wrote:

On 26/02/2012 11:17, Mattias Gaertner wrote:

On Sun, 26 Feb 2012 11:43:38 +0100 (CET) Michael Van Canneyt
  wrote:



On Sun, 26 Feb 2012, Vinzent Höfler wrote:


On Sat, 25 Feb 2012 19:15:54 +0100, ik
  wrote:


I found the following amazing lecture that present a new idea
of a development tool, that I think will interest you all:

http://vimeo.com/36579366

Impressive, indeed. And I am usually not that easily impressed.

Impressed indeed. But IMHO limited to a certain kind of
programming. The binary search part could probably be done for any
kind of programming, I suppose.

I doubt that "any kind of programming". He showed the simplest case:
a function that only receives base types. But most functions work on
complex parameters - classes. These need to be set up. Either by
writing a test environment or by taking a snapshot with the debugger.
Then you can run the function repeatedly.

The next step is to "compile" the function on every change. Easy with
an interpreter. How to compile only one function of a big program and
insert/replace it?

Sorry for a plug, but MS VC++ 6.0 (!)* allowed for Pause->Edit Code->
Quick compile->Resume Execution kind of workflow...

Yes, in Debug/Pause mode, you COULD write a {code block} and then go
Debug->Apply and Continue (or something like that) and voila,
you could totally change code paths ...
(Not that I know much about internals/constraints of this, to be honest,
but of all, i found that a very cool feature)

Is there a way to add THAT to FPC/Lazarus/GDB world ?



I wonder where the limits of that are.

Sure one *could* record *all* variables, and the callstack...
But what if
- you add a new variable, what to initialize it with?
- remove the function that called the current code, or even delete the 
line where you just paused?


Or one could record all input, and replay the app. But that has limits too.

Neither of those are likely to happen


btw on some platforms, gdb can step backwards (again limitations apply). 
But it's not integrated in Lazarus yet...


Noting what I described looking at in 
http://lists.freepascal.org/lists/fpc-other/2012-February/000670.html, I 
found myself wondering whether the IDE could tweak (writable?) constants 
at runtime, or possibly closures once they exist.


Being able to tune e.g. the exact position of visible components could 
be rather useful.


--
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/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-03-01 Thread Jonas Maebe


On 01 Mar 2012, at 09:29, Noa Shiruba wrote:

It's not used as a unit name, but there might be "something"   
"somewhere" hiding, so I am not ready to file a bug report on it yet.


It's probably better to make another demo program with less cruft.


It's possible that compiling with -vh will make the compiler tell you  
where it was previously defined.



Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread michael . vancanneyt



On Thu, 1 Mar 2012, Reinier Olislagers wrote:


When that didn't throw up errors and generated a valid ibconnection.chm,
I didn't look for any further errors.


It should have given you the same errors as I got. But it will produce a
chm file, simply with some parts missing.

Originally, fpdoc would simply bomb out on the smallest mistake.

I got plenty of complaints about that, so now, recoverable errors are just
displayed, but fpdoc will happily grind on and try and produce a file.


I understand why you changed it, but didn't get any error messages
either - just redownloaded the original patch upload to make sure:

D:\Cop\t>c:\development\fpc\utils\fpdoc\fpdoc.exe --package=fcl
--input=C:\Development\fpc\packages\fcl-db\src\sqldb\interbase\ibconnection.pp
--format=chm --output=ibconnection.chm --content
FPDoc - Free Pascal Documentation Tool
Version 2.6.1 [2012/02/29]
(c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, s...@freepascal.org

Writing 91 pages...
HTML Files written. Collecting other files and compressing...this could
take some time
Finishing compressing...
Done.


This is what I get:

[#fcl.IBConnection.TIBConnection] Invalid paragraph content
[#fcl.IBConnection.TIBConnection] Invalid paragraph content
[#fcl.IBConnection.TIBConnection.Dialect] Invalid description (illegal XML element: 
"#text")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal XML element: 
"var")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal XML element: 
"#text")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal XML element: 
"link")
[#fcl.IBConnection.TIBConnection.Params] Invalid description (illegal XML element: 
"#text")
Done.

But I don't use chm, but latex. I suppose the xml->html converter is more
forgiving about mistakes in your XML; maybe it takes some shortcuts. 
I would have to investigate.


It's something to note, in each case.

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


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Reinier Olislagers
On 1-3-2012 9:43, michael.vancann...@wisa.be wrote:
> 
> 
> On Thu, 1 Mar 2012, Reinier Olislagers wrote:
> 
>> On 29-2-2012 20:52, Michael Van Canneyt wrote:
>>>
>>>
>>> On Wed, 29 Feb 2012, Reinier Olislagers wrote:
>>>
 On 29-2-2012 17:07, michael.vancanneyt-0is9kj9s...@public.gmane.org
 wrote:
> On Wed, 29 Feb 2012, Frank Church wrote:
>> Another question, are you and Florian Klaempfl the main or only
>> contributors?
>
> I am virtually the only one, but I do receive and apply minor patches
> from time to time.
 *Cough*
 http://bugs.freepascal.org/view.php?id=20735
 *cough*

 I'd love to see that patch committed or get some feedback on it ;)
>>>
>>> oh :/
>>>
>>> I tried it at once when you submitted it.
>>> But there were quite some errors in the XML, which is why I left it for
>>> later...
>>>
>>>  and eventually forgot about it :(
>>>
>>> My apologies for this.
>>>
>>> I now corrected the XML and committed it. Rev 892.
>>>
>> Thanks Michael,
>>
>> Sorry about the errors, glad it got committed!
>>
>> I did try to check for errors, e.g. with something like:
>> cd /d D:\Reinier\Documents\SourceCode\fpc_laz_patch_playground\docs
>>
>> rem all on one line ;)
>> c:\development\fpc\utils\fpdoc\fpdoc.exe
>> --package=fcl
>> --input=C:\Development\fpc\packages\fcl-db\src\sqldb\interbase\ibconnection.pp
>>
>>
>> --format=chm
>> --output=ibconnection.chm
>>
>> When that didn't throw up errors and generated a valid ibconnection.chm,
>> I didn't look for any further errors.
> 
> It should have given you the same errors as I got. But it will produce a
> chm file, simply with some parts missing.
> 
> Originally, fpdoc would simply bomb out on the smallest mistake.
> 
> I got plenty of complaints about that, so now, recoverable errors are just
> displayed, but fpdoc will happily grind on and try and produce a file.

I understand why you changed it, but didn't get any error messages
either - just redownloaded the original patch upload to make sure:

D:\Cop\t>c:\development\fpc\utils\fpdoc\fpdoc.exe --package=fcl
--input=C:\Development\fpc\packages\fcl-db\src\sqldb\interbase\ibconnection.pp
--format=chm --output=ibconnection.chm --content
FPDoc - Free Pascal Documentation Tool
Version 2.6.1 [2012/02/29]
(c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, s...@freepascal.org

Writing 91 pages...
HTML Files written. Collecting other files and compressing...this could
take some time
Finishing compressing...
Done.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Reinier Olislagers
On 1-3-2012 9:16, Frank Church wrote:
> On 29 February 2012 19:52, Michael Van Canneyt  
> On Wed, 29 Feb 2012, Reinier Olislagers wrote:
> I'd love to see that patch committed or get some feedback on it ;)
> But there were quite some errors in the XML, which is why I left it
> for later...
> Isn't this an example of what is considered wrong with the FPC/Lazarus
> processes?
> 
> At the very least if Reinier did not have the rights to commit, he
> should have had a duplicate set of the tools  Michael used to check of
> the correctness of the file (assuming that it was not visually
> inspected). If there was some automated system capable of checking the
> file's syntax and accepting it, Reinier would have known straight away
> and fixed it immediately. Others who have registered an interest in that
> topic would also have been automatically emailed then they could review
> the correctness and quality of the contents etc. Perhaps they exist and
> I and a lot of others don't know about them.

Good point.
I do suspect they might exist but might be just not well known enough
for people to stumble on... I hope this thread brings them out.

As for people being emailed etc... there's a separate docs category in
Mantis... so people interested in docs could follow that anyway...

(Apart from that, I don't know if you noticed, but I did email the list
in November with the docs before submitting the patch... which might be
a good idea if submitting larger changes..)


> There is also one thing. The documentation of the libraries and the
> compiler proper are different issues. In the case of the libraries
> shouldn't those who create them have commit rights in that area assuming
> that they have the tools to check the syntactic correctness of their
> submissions?
Actually, why not leave it as is but couple it with DoDi's idea: people
submitting patches for libraries should also include documentation -
even if it's just the barest notes. If not, their patch does not get
into the code.
Yes, they would need a tool to check syntactic correctness in any case.

If they already have commit rights on the source code repository, it
might be useful to also allow them on the fpdocs repository...
IMO, sketchy documentation is better than none - people that know the
libraries shouldn't be deterred to contribute docs.
A solution might be to mark a package in the documentation as "temporary
documentation" or something which gets output to the help.

That might be a compromise between having tight control of docs (current
situation) and fewer barriers to contribute...

However, already having an automated way of checking the XML would be a
large step forward...

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


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread michael . vancanneyt



On Thu, 1 Mar 2012, Reinier Olislagers wrote:


On 29-2-2012 20:52, Michael Van Canneyt wrote:



On Wed, 29 Feb 2012, Reinier Olislagers wrote:


On 29-2-2012 17:07, michael.vancanneyt-0is9kj9s...@public.gmane.org
wrote:

On Wed, 29 Feb 2012, Frank Church wrote:

Another question, are you and Florian Klaempfl the main or only
contributors?


I am virtually the only one, but I do receive and apply minor patches
from time to time.

*Cough*
http://bugs.freepascal.org/view.php?id=20735
*cough*

I'd love to see that patch committed or get some feedback on it ;)


oh :/

I tried it at once when you submitted it.
But there were quite some errors in the XML, which is why I left it for
later...

 and eventually forgot about it :(

My apologies for this.

I now corrected the XML and committed it. Rev 892.


Thanks Michael,

Sorry about the errors, glad it got committed!

I did try to check for errors, e.g. with something like:
cd /d D:\Reinier\Documents\SourceCode\fpc_laz_patch_playground\docs

rem all on one line ;)
c:\development\fpc\utils\fpdoc\fpdoc.exe
--package=fcl
--input=C:\Development\fpc\packages\fcl-db\src\sqldb\interbase\ibconnection.pp

--format=chm
--output=ibconnection.chm

When that didn't throw up errors and generated a valid ibconnection.chm,
I didn't look for any further errors.


It should have given you the same errors as I got. 
But it will produce a chm file, simply with some parts missing.


Originally, fpdoc would simply bomb out on the smallest mistake.

I got plenty of complaints about that, so now, recoverable errors are just
displayed, but fpdoc will happily grind on and try and produce a file.

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


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread michael . vancanneyt



On Thu, 1 Mar 2012, Frank Church wrote:


On 29 February 2012 19:52, Michael Van Canneyt wrote:




On Wed, 29 Feb 2012, Reinier Olislagers wrote:

 On 29-2-2012 17:07, 
michael.vancanneyt-**0is9kj9s...@public.gmane.orgwrote:



On Wed, 29 Feb 2012, Frank Church wrote:


Another question, are you and Florian Klaempfl the main or only
contributors?



I am virtually the only one, but I do receive and apply minor patches
from time to time.


*Cough*
http://bugs.freepascal.org/**view.php?id=20735
*cough*

I'd love to see that patch committed or get some feedback on it ;)



oh :/

I tried it at once when you submitted it.
But there were quite some errors in the XML, which is why I left it for
later...

 and eventually forgot about it :(

My apologies for this.

I now corrected the XML and committed it. Rev 892.

Thank you for the contribution !

Michael.

__**_
fpc-pascal maillist  -  
fpc-pascal@lists.freepascal.**org
http://lists.freepascal.org/**mailman/listinfo/fpc-pascal




Isn't this an example of what is considered wrong with the FPC/Lazarus
processes?


Absolutely not.


At the very least if Reinier did not have the rights to commit, he should
have had a duplicate set of the tools  Michael used to check of the
correctness of the file (assuming that it was not visually inspected). If
there was some automated system capable of checking the file's syntax and
accepting it, Reinier would have known straight away and fixed it


He has all the needed tools and he should have done so prior to submitting.

That he did not check before submitting is not an error in the system, but his 
mistake.

That I didn't notify him of the errors when I first checked, is my mistake.



immediately. Others who have registered an interest in that topic would
also have been automatically emailed then they could review the correctness
and quality of the contents etc. Perhaps they exist and I and a lot of
others don't know about them.

At this stage it doesn't look like Reinier knows what the flaws in the file
he submitted are, unless he diffs what Michael committed against what he
submitted



He could perfectly have run fpdoc on the file. The command

fpdoc --package=fcl --input=ibconnection.pp --descr=ibconnection.xml 
--output=latex

would have given him all the info he needs. The standalone editor can
construct and run this command for you, if I'm correct. The Makefiles contain
lots of examples, waiting to be consulted. And all this is documented in
official docs on the Free Pascal website.

What more can people want ?


Imagine what happens when more and more people submit docs and the extra
work for the few people with commit rights.


Everyone on the FPC/lazarus teams has commit rights. 
It's just like regular submissions.



There is also one thing. The documentation of the libraries and the
compiler proper are different issues. In the case of the libraries
shouldn't those who create them have commit rights in that area assuming
that they have the tools to check the syntactic correctness of their
submissions?


But they do. But this doesn't help in this particular case.

Reinier didn't create the ibconnection unit; He has no SVN access to
anything. I assume he uses the unit, and therefor decided to document it.

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


Re: [fpc-pascal] Re: Duplicate Identifier

2012-03-01 Thread Noa Shiruba
Hi leledumbo,

I also tend to Think it's something like that with non-scoped records or 
something similar.  (this is mostly non-oop code, but there are record types 
with members called "tile" in other units that get pulled in...)

However the compiler specifically names other units as the culprit, so who 
knows. 

Thank you,
Noah silva

On 2012/03/01, at 16:29, leledumbo  wrote:

> That's different case IMHO (In My Humble Observation), I guess it's something
> like this:
> 
> {$mode objfpc}
> type
>  TTestClass = class
>FTile: Integer;
>property Tile: Integer read FTile write FTile;
>procedure Test;
>  end;
> 
> procedure TTestClass.Test;
> var
>  Tile: Integer;
> begin
> end;
> 
> begin
> end.
> 
> In this case, the local variable has the same name as one of the class
> properties. This does trigger the "duplicate identifier" error because both
> have the same scope.
> 
> --
> View this message in context: 
> http://free-pascal-general.1045716.n5.nabble.com/Re-Duplicate-Identifier-tp5526700p5527107.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/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Reinier Olislagers
On 29-2-2012 20:52, Michael Van Canneyt wrote:
> 
> 
> On Wed, 29 Feb 2012, Reinier Olislagers wrote:
> 
>> On 29-2-2012 17:07, michael.vancanneyt-0is9kj9s...@public.gmane.org
>> wrote:
>>> On Wed, 29 Feb 2012, Frank Church wrote:
 Another question, are you and Florian Klaempfl the main or only
 contributors?
>>>
>>> I am virtually the only one, but I do receive and apply minor patches
>>> from time to time.
>> *Cough*
>> http://bugs.freepascal.org/view.php?id=20735
>> *cough*
>>
>> I'd love to see that patch committed or get some feedback on it ;)
> 
> oh :/
> 
> I tried it at once when you submitted it.
> But there were quite some errors in the XML, which is why I left it for
> later...
> 
>  and eventually forgot about it :(
> 
> My apologies for this.
> 
> I now corrected the XML and committed it. Rev 892.
> 
Thanks Michael,

Sorry about the errors, glad it got committed!

I did try to check for errors, e.g. with something like:
cd /d D:\Reinier\Documents\SourceCode\fpc_laz_patch_playground\docs

rem all on one line ;)
c:\development\fpc\utils\fpdoc\fpdoc.exe
--package=fcl
--input=C:\Development\fpc\packages\fcl-db\src\sqldb\interbase\ibconnection.pp

--format=chm
--output=ibconnection.chm

When that didn't throw up errors and generated a valid ibconnection.chm,
I didn't look for any further errors.

Perhaps there's a better way to check for errors?

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


Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-03-01 Thread Noa Shiruba
Sven,

It's not used as a unit name, but there might be "something"  "somewhere" 
hiding, so I am not ready to file a bug report on it yet.

It's probably better to make another demo program with less cruft.

-- Noah 

On 2012/03/01, at 16:13, Sven Barth  wrote:

> Am 01.03.2012 01:43, schrieb Noa Shiruba:
>> Hi Sven,
>> 
>> Several of my programs stopped compiling with "duplicate identifier" errors 
>> where I had something like:
>> 
>> Var Tile:TOSMTile;
>> 
>> I thing the offending unit was Graphics, but I am not 100% sure.
>> 
>> (I just did search and replace of Tile to MapTile in my code to fix it once 
>> I realized the conflicting definition Was coming from one of the standard 
>> units).
> 
> This is strange. As leledumbo said a "duplicated identifier" error should 
> only appear if you used "tile" inside the current unit already. Are you sure 
> you didn't use it as unit name? If you can still reproduce it when you use 
> "tile" again, can you narrow down the problem and please report a bug if it's 
> not an oversight by you?
> 
> Regards,
> Sven
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Duplicate Identifier

2012-03-01 Thread Noa Shiruba
Sven,

No, I used it only in TW var section of various methods as a temporary 
structure.  I should note that this compiled in FPC 2.4 fine.

(that said, the source code in question is quite messy...)

-- Noah 

On 2012/03/01, at 16:17, Sven Barth  wrote:

> Am 01.03.2012 03:35, schrieb Noah Silva:
>> Hi leledumbo,
>> 
>> (Changing the topic to indicate OT)
>> 
>> I didn't really take time to figure out whether it "should" be happening
>> or not, I just changed the references not to conflict.  If you are
>> interested, though, I reproduced it in the screenshot below for you:
>> 
>> https://picasaweb.google.com/lh/photo/qXJYu68KE20oWWM2loKWTtMTjNZETYmyPJy0liipFm0?feat=directlink
> 
> Hmm. Did you use "Tile" as a field or property of the class TfrmMap already? 
> Then this is expected, because FPC will in non-Delphi modes error if you 
> reuse an identifier, which is already used as a field or property, as a type 
> or local parameter of a method that belongs to the same class.
> 
> Regards,
> Sven
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Where and how is the FPC documentation created?

2012-03-01 Thread Frank Church
On 29 February 2012 19:52, Michael Van Canneyt wrote:

>
>
> On Wed, 29 Feb 2012, Reinier Olislagers wrote:
>
>  On 29-2-2012 17:07, 
> michael.vancanneyt-**0is9kj9s...@public.gmane.orgwrote:
>>
>>> On Wed, 29 Feb 2012, Frank Church wrote:
>>>
 Another question, are you and Florian Klaempfl the main or only
 contributors?

>>>
>>> I am virtually the only one, but I do receive and apply minor patches
>>> from time to time.
>>>
>> *Cough*
>> http://bugs.freepascal.org/**view.php?id=20735
>> *cough*
>>
>> I'd love to see that patch committed or get some feedback on it ;)
>>
>
> oh :/
>
> I tried it at once when you submitted it.
> But there were quite some errors in the XML, which is why I left it for
> later...
>
>  and eventually forgot about it :(
>
> My apologies for this.
>
> I now corrected the XML and committed it. Rev 892.
>
> Thank you for the contribution !
>
> Michael.
>
> __**_
> fpc-pascal maillist  -  
> fpc-pascal@lists.freepascal.**org
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal
>


Isn't this an example of what is considered wrong with the FPC/Lazarus
processes?

At the very least if Reinier did not have the rights to commit, he should
have had a duplicate set of the tools  Michael used to check of the
correctness of the file (assuming that it was not visually inspected). If
there was some automated system capable of checking the file's syntax and
accepting it, Reinier would have known straight away and fixed it
immediately. Others who have registered an interest in that topic would
also have been automatically emailed then they could review the correctness
and quality of the contents etc. Perhaps they exist and I and a lot of
others don't know about them.

At this stage it doesn't look like Reinier knows what the flaws in the file
he submitted are, unless he diffs what Michael committed against what he
submitted

Imagine what happens when more and more people submit docs and the extra
work for the few people with commit rights.

There is also one thing. The documentation of the libraries and the
compiler proper are different issues. In the case of the libraries
shouldn't those who create them have commit rights in that area assuming
that they have the tools to check the syntactic correctness of their
submissions?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal