View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0038071||FPC||Documentation||public||2020-11-12 15:40||2020-11-16 16:44|
|Reporter||OkobaPatino||Assigned To||Michael Van Canneyt|
|Fixed in Version||3.3.1|
|Summary||0038071: State that declaration global operators in Delphi mode is not possible|
|Description||It is not clear from this document that it is impossible to declare a global operator for a type.|
It should be something like this that these operators are not recognized in Delphi mode:
To be clear, this code is not possible in Delphi mode but possible in objfpc mode:
complex = record
operator assign (r: Real) z: complex;
z.re := r;
z.im := 0.0;
C := R;
|Tags||No tags attached.|
|Fixed in Revision||1774.|
||B.t.w.: It also does not mention that you cannot use syntax like "operator + (R,L: TSomeType): TSomeType", but you have to use symbolic types ("add" in this case). At least according to Ebarcadero: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Operator_Overloading_(Delphi)|
Bart, it _does_ say below the table 15.1 “Operator Names”, quote:
*Remark* When compiling in `Delphi` mode the names of the operators _must_ be used, not the symbols.
The official docs are at ftp://ftp.freepascal.org/pub/fpc/docs-pdf/ref.pdf
This document does NOT have a table in section 15.1 and the phrase "the names of the operators" does not appear in the entire document.
@Kai: I see now that you refer to https://www.freepascal.org/docs-html/ref/refse102.html
As far as I understand Michael, the “official” official documentation is the repository. Supplying a PDF version is just a complimentary service, so are the HTML pages. If the tools used for that (pdflatex, text2ht) do not generate appropriate documents, it is “not our department”. After all, the source code `ref.tex` _does_ contain the proper statements.
> Are they?
Maybe, or maybe not.
I would expect the pdf to be the same as the html files, since https://freepascal.org/docs.html points to the pdf in question.
I used the pdf, because you can search the whole document for phrases.
But this becomes a bit off-topic for the mattaer at hand.
Reworked the documentation on operator overloading.
- Global operators are not at all supported in mode Delphi.
- Global operators only work with symbols (+/-=* etc).
- In record class operator definitions, objfpc mode requires symbols, delphi mode allows both symbols and names.
Unfortunately, the PDF documentation files on the FTP site had not been updated :-(
(you could have spotted this in the version number, they dated from 2017)
But I did this now. Good that this discussion arose, or I would never have noticed.
When does the live document (that I linked to) will be updated?
||When 3.2.2 is released, this should hopefully still be this year.|
Where can I check the last version documentation before reporting such a bug in the future? As maybe this one was fixed already, and the live version that I reported was old.
I checked the commit list of this (https://github.com/graemeg/freepascal/commits/master) mirror, but I couldn't find the change.
svn co https://svn.freepascal.org/svn/fpcdocs
Or on the web:
So there is no way to see them as the web document (with pages like the live version) to find the values quickly.
Something like https://dev.mysql.com/doc/refman/5.7/en/ to move between versions will be useful.
But I found your changes, and they are much more apparent. Thank you.
Checked and it is now clear.
|2020-11-12 15:40||OkobaPatino||New Issue|
|2020-11-12 15:40||OkobaPatino||Status||new => assigned|
|2020-11-12 15:40||OkobaPatino||Assigned To||=> Michael Van Canneyt|
|2020-11-12 17:07||Michael Van Canneyt||Relationship added||has duplicate 0038072|
|2020-11-12 17:09||Bart Broersma||Note Added: 0126864|
|2020-11-13 02:03||Kai Burghardt||Note Added: 0126869|
|2020-11-13 12:44||Bart Broersma||Note Added: 0126875|
|2020-11-13 12:50||Bart Broersma||Note Edited: 0126875||View Revisions|
|2020-11-13 13:05||Kai Burghardt||Note Added: 0126876|
|2020-11-13 14:41||Bart Broersma||Note Added: 0126878|
|2020-11-13 15:50||Michael Van Canneyt||Status||assigned => resolved|
|2020-11-13 15:50||Michael Van Canneyt||Resolution||open => fixed|
|2020-11-13 15:50||Michael Van Canneyt||Fixed in Version||=> 3.3.1|
|2020-11-13 15:50||Michael Van Canneyt||Fixed in Revision||=> 1774.|
|2020-11-13 15:50||Michael Van Canneyt||FPCTarget||=> 3.2.2|
|2020-11-13 15:50||Michael Van Canneyt||Note Added: 0126882|
|2020-11-13 15:53||Michael Van Canneyt||Note Added: 0126884|
|2020-11-14 06:47||OkobaPatino||Note Added: 0126908|
|2020-11-14 10:19||Michael Van Canneyt||Note Added: 0126911|
|2020-11-14 10:39||OkobaPatino||Note Added: 0126913|
|2020-11-14 10:49||Michael Van Canneyt||Note Added: 0126915|
|2020-11-14 12:21||OkobaPatino||Note Added: 0126921|
|2020-11-16 16:44||OkobaPatino||Status||resolved => closed|
|2020-11-16 16:44||OkobaPatino||Note Added: 0126985|